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 another user joins the 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 joined the chateditor
: User object representing the user who invited the other user(s) to the chat
CHAT_LEFT¶
Event triggered when some user leaves the 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 joined the chateditor
: User object representing the user who removed the other user(s) from the chat
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 users who joined the chateditor
: User object representing the user who removed the other user(s) 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_ALLOW_MUTE_NOTIFICATIONS_CHANGED¶
Event triggered when the allow_mute_notifications
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_mute_notifications
: boolean. Whether members of the chat can mute notificationseditor
: 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)