teamwire_api/events¶
Events¶
Chat Event
NEW_MESSAGE¶
Event triggered when a new message arrives to a chat that the bot is subscribed to. The event handler is called with a Message object as extra parameter.
MESSAGE_READ¶
Event triggered when someone has read the latest messages in a chat. The extra argument will contain a MessageReadInfo object with the following attributes:
chat: Chat object. The chat this event refers touser: User object. The user who read the messagemessage_id: unicode. The id of the last read messageread_date: datetime. When the message has been read
MESSAGE_DELETED¶
Event triggered when a message gets deleted by the sender. The extra argument will contain a MessageDeletedInfo object with the following attributes:
chat: Chat object. The chat this event refers tomessage_id: unicode. The id of the deleted message
CHAT_CREATED¶
Event triggered when a new chat is created. The extra argument will contain a ChatChangeInfo object with the following attributes:
chat: Chat object. The chat this event refers totitle: (string - the title of the new chat)
CHAT_JOINED¶
Event triggered when the bot is added to a chat. The extra argument will contain a ChatMemberChangeInfo object with the following attributes:
chat: Chat object. The chat this event refers tousers: list of User. The bot user that joined the chatcircles: not meaningful for this event; present only becauseChatMemberChangeInfois reused, currently emptyeditor: User object representing the user who added the bot to the chat
CHAT_MEMBERS_ADDED¶
Event triggered when direct users, circles or roles are added to a chat. The extra argument will contain a ChatMemberChangeInfo object with the following attributes:
chat: Chat object. The chat this event refers tousers: list of User. The users who were added to the chatcircles: list of Group. The circles that were added to the chatroles: list of Role. The roles that were added to the chateditor: User object representing the user who added the member(s)
CHAT_MEMBERS_REMOVED¶
Event triggered when direct users, circles or roles are removed from a chat. The extra argument will contain a ChatMemberChangeInfo object with the following attributes:
chat: Chat object. The chat this event refers tousers: list of User. The users who were removed from the chatcircles: list of Group. The circles that were removed from the chatroles: list of Role. The roles that were removed from the chateditor: User object representing the user who removed the member(s)
CIRCLE_USERS_ADDED¶
Event triggered when users are added to a circle that is a member of a chat. The extra argument will contain a CircleMemberUpdateInfo object with the following attributes:
chat: Chat object. The chat this event refers tousers: list of User. The users who were added to the circlecircles: list of Group. The circle that received the userseditor: User object representing the user who added the users
CIRCLE_USERS_REMOVED¶
Event triggered when users are removed from a circle that is a member of a chat. The extra argument will contain a CircleMemberUpdateInfo object with the following attributes:
chat: Chat object. The chat this event refers tousers: list of User. The users who were removed from the circlecircles: list of Group. The circle that lost the userseditor: User object representing the user who removed the users
CIRCLES_DELETED¶
Event triggered when circles are deleted and removed from a chat. The extra argument will contain a ChatMemberChangeInfo object with the following attributes:
chat: Chat object. The chat this event refers tousers: empty listcircles: list of Group. The deleted circles that were removed from the chateditor: User object representing the user who deleted the circles, if available
ROLES_JOINED¶
Event triggered when a user joins one or more roles in a chat. The extra argument will contain a ChatMemberChangeInfo object with the following attributes:
chat: Chat object. The chat this event refers tousers: list of User. The user who joined the rolesroles: list of Role. The roles joined by the usereditor: User object representing the user who performed the operation
ROLES_LEFT¶
Event triggered when a user leaves one or more roles in a chat. The extra argument will contain a ChatMemberChangeInfo object with the following attributes:
chat: Chat object. The chat this event refers tousers: list of User. The user who left the rolesroles: list of Role. The roles left by the usereditor: User object representing the user who performed the operation
ROLE_USERS_REMOVED¶
Event triggered when users are removed from a role in a chat. The extra argument will contain a ChatMemberChangeInfo object with the following attributes:
chat: Chat object. The chat this event refers tousers: list of User. The users removed from the roleroles: list of Role. The affected roles, if availableeditor: User object representing the user who performed the operation, if available
ROLES_DELETED¶
Event triggered when roles are deleted and removed from a chat. The extra argument will contain a ChatMemberChangeInfo object with the following attributes:
chat: Chat object. The chat this event refers tousers: empty listroles: list of Role. The deleted roles removed from the chateditor: User object representing the user who deleted the roles, if available
CHAT_DELETED¶
Event triggered when the bot is removed from a chat. The extra argument will contain a ChatMemberChangeInfo object with the following attributes:
chat: Chat object. The chat this event refers tousers: list of User. The bot user that was removed from the chatcircles: empty listeditor: User object representing the user who removed the bot from the chat
CHAT_TITLE_CHANGED¶
Event triggered when the title of the chat has been changed. The extra argument will contain a ChatChangeInfo object with the following attributes:
chat: Chat object. The chat this event refers totitle: string. The new title of the chateditor: User object representing the user who performed the operation
CHAT_ADMINS_CHANGED¶
Event triggered when the administrators list of the chat has been changed. The extra argument will contain a ChatChangeInfo object with the following attributes:
chat: Chat object. The chat this event refers toadded_admins: list of User objects. The users who were made chat administratorsremoved_admins: list of User objects. The users who were removed from the administrators listeditor: User object representing the user who performed the operation
CHAT_ALLOW_SENDING_CHANGED¶
Event triggered when the allow_sending property of the chat has been changed. The extra argument will contain a ChatChangeInfo object with the following attributes:
chat: Chat object. The chat this event refers toallow_sending: boolean. Whether other members of the chat can send messageseditor: User object representing the user who performed the operation
CHAT_IS_CLOSED_CHANGED¶
Event triggered when the is_closed property of the chat has been changed. The extra argument will contain a ChatChangeInfo object with the following attributes:
chat: Chat object. The chat this event refers tois_closed: boolean. Whether the chat has been closededitor: User object representing the user who performed the operation
ConnectionEvents¶
Backend connectivity Event
BACKEND_CONNECTED¶
Event triggered when the bot is connected to the backend notifications service
BACKEND_DISCONNECTED¶
Event triggered when the bot has been disconnected from the backend notifications service (e.g. for network connectivity issues)