onAppAddedToConversation
The App has been added to a conversation.
Use this event to welcome participants and explain how the App works.
Received properties
conversation
Details of the conversation the App joined, provided as a ConversationData object:
id— Unique conversation ID (QualifiedId).name— Conversation name. Null for 1:1 conversations.teamId— Team ID the conversation belongs to. Null for 1:1 conversations.mlsGroupId— Opaque identifier a conversation.type— Conversation type:GROUP— A group conversation or channel that can include one or more members.ONE_TO_ONE— A direct conversation between one user and the App.SELF— A conversation containing only the App.
members
List of members in the conversation, represented by ConversationMember objects. Each member includes:
userId— Unique user ID (QualifiedId).role— The user’s role in the conversation:ADMINorMEMBER.
Sample usage
Send welcome message
- Kotlin
- Java
override suspend fun onAppAddedToConversation(
conversation: ConversationData,
members: List<ConversationMember>
) {
val message = WireMessage.Text.create(
conversationId = conversation.id,
text = "👋 Hi there! You can use `/remind [text]` to set personal reminders."
)
manager.sendMessageSuspending(message = message)
}
@Override
public void onAppAddedToConversation(
@NotNull ConversationData conversation,
@NotNull List<ConversationMember> members
) {
final WireMessage message = WireMessage.Text.create(
conversation.id(),
"👋 Hi there! You can use `/remind [text]` to set personal reminders.",
List.of(),
List.of(),
null
);
getManager().sendMessage(message);
}