Direct and group chats
Direct chats
Installation gives the bot /start, chat_id, and session_id. The bot may post without another invocation while the installation remains active.
Group chats
Only room administrators can add or remove a bot. A bot is added once per room and receives only mentions and replies to its own messages.
Event actor
actor includes a bot-scoped stable id, username, and display_name. Avatar, phone, email, member list, and global Matrix id are not exposed.
Notifications
Direct bot notifications have their own toggle. Group bot messages follow the notification settings of the group.
SDK practice
In groups, respond only to mentions or replies delivered by the platform. Do not attempt to recover membership or history through side channels.
session_id changes after a direct-chat restart. Reset conversational state when a new session arrives.
Usage examples
const { chat_id, chat_type, actor, message } = event.data;
if (chat_type === 'group' && message.reply_to_bot !== true) return {};
await bot.reply(chat_id, message.event_id, { text: `Hello, ${actor.display_name}` });