teamwire_api.notifications

NotificationInfoBase

class NotificationInfoBase(object)

A base class for notification events

ChatMemberChangeInfo

class ChatMemberChangeInfo(NotificationInfoBase)

It contains information about changes to the members of a chat

It is used with the following events:

  • Events.CHAT_JOINED: Event triggered when another user joins the chat. The users attribute will contain the list of users that joined the chat
  • Events.CHAT_LEFT: Event triggered when some user leaves the chat. The users attribute will contain the list of users that left the chat
  • Events.CHAT_DELETED: Event triggered when the bot is removed from a chat. The users attribute will contain the list of users (including the bot's user) that were removed from the chat

Attributes

  • chat: Chat object. The chat this event refers to
  • users: list of User objects. The users that joined or left the chat
  • editor: User object. The user who invited or removed the other user(s) to/from the chat

ChatChangeInfo

class ChatChangeInfo(NotificationInfoBase)

It contains information about chat creation, or changes to the title or administrators of a chat

It is used with the following events:

  • Events.CHAT_CREATED: Event triggered when a new chat is created. The chat attribute will contain the newly created chat
  • Events.CHAT_TITLE_CHANGED: Event triggered when the title of the chat has been changed. The 'title' attribute will contain the new title of the chat
  • Events.CHAT_ADMINS_CHANGED: Event triggered when the administrators list of the chat has been changed. The added_admins and the removed_admins attributes will respectively contain the lists of users that bacame admins or that were removed from admins
  • Events.CHAT_ALLOW_SENDING_CHANGED: Event triggered when the allow_sending property of the chat has been changed. The allow_sending attribute will contain the new value
  • Events.CHAT_ALLOW_MUTE_NOTIFICATIONS_CHANGED: Event triggered when the allow_mute_notifications property of the chat has been changed. The allow_mute_notifications attribute will contain the new value
  • Events.CHAT_IS_CLOSED_CHANGED: Event triggered when the is_closed property of the chat has been changed. The is_closed attribute will contain the new value

Attributes

  • chat: Chat object. The chat this event refers to
  • title: unicode (None if not present). The new title of the chat
  • added_admins: list of User objects. The users that were made chat administrators
  • removed_admins: list of User objects. The users that were removed from the chat administrators
  • allow_sending: boolean. Whether other members of the chat can send messages
  • allow_mute_notifications: boolean. Whether members of the chat can mute notifications
  • is_closed: boolean. Whether the chat has been closed or reopened
  • editor: User object. The user who initiated the operation

MessageDeletedInfo

class MessageDeletedInfo(NotificationInfoBase)

It contains information about the deletion of a message

It is used with the following events:

  • Events.MESSAGE_DELETED: Event triggered when a message is deleted from a chat

Attributes

  • chat: Chat object. The chat this event refers to
  • message_id: unicode. The id of the deleted message

MessageReadInfo

class MessageReadInfo(NotificationInfoBase)

It contains information about the deletion of a message

It is used with the following events:

  • Events.MESSAGE_READ: Event triggered when someone has read the latest messages in a chat

Attributes

  • chat: Chat object. The chat this event refers to
  • user: User object. The user who read the message
  • message_id: unicode. The id of the last read message
  • read_date: datetime. When the message has been read