Skip to content

teamwire_api/notifications

Notification event payload objects for Teamwire SDK events.

NotificationInfoBase

@dataclass
class NotificationInfoBase()

Base DTO for notification events.

ChatMemberChangeInfo

@dataclass
class ChatMemberChangeInfo(NotificationInfoBase)

It contains information about changes to the members of a chat

It is used with the following events:

  • Events.CHAT_JOINED: the bot was added to a chat
  • Events.CHAT_MEMBERS_ADDED: direct users, circles or roles were added to a chat
  • Events.CHAT_MEMBERS_REMOVED: direct users, circles or roles were removed from a chat
  • Events.CIRCLES_DELETED: circles were deleted and removed from the chat
  • Events.ROLES_JOINED: a user joined one or more roles in the chat
  • Events.ROLES_LEFT: a user left one or more roles in the chat
  • Events.ROLE_USERS_REMOVED: users were removed from a role in the chat
  • Events.ROLES_DELETED: roles were deleted and removed from the chat
  • Events.CHAT_DELETED: the bot lost access to the chat

Attributes

  • chat: Chat object. The chat this event refers to
  • users: list of User objects. The users affected by the event
  • circles: list of Group objects. The circles affected by the event
  • roles: list of Role objects. The roles affected by the event
  • editor: User object. The user who initiated the operation

CircleMemberUpdateInfo

@dataclass
class CircleMemberUpdateInfo(ChatMemberChangeInfo)

It contains information about changes to the members of a circle

It is used with the following events:

  • Events.CIRCLE_USERS_ADDED: users were added to a circle that is a member of the chat
  • Events.CIRCLE_USERS_REMOVED: users were removed from a circle that is a member of the chat

Attributes

  • chat: Chat object. The chat this event refers to
  • users: list of User objects. The users affected by the event
  • circles: one-element list of Group objects. The affected circle

ChatChangeInfo

@dataclass
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_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
  • is_closed: boolean. Whether the chat has been closed or reopened
  • editor: User object. The user who initiated the operation

MessageDeletedInfo

@dataclass
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
  • editor: User object. The chat admin who deleted the message, or None if the message was deleted by its sender

MessageReadInfo

@dataclass
class MessageReadInfo(NotificationInfoBase)

It contains information about a read-receipt update

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