PubSub Events

Accounts

class accounts.events.JoinedOrganization(dt, user, organization)
Returns:
  • user (Object) - user object
    • id (int) - user ID
    • username (string)
    • firstName (string)
    • lastName (string)
    • displayName (string)
    • email (string)
    • avatar (string) - URL to the user’s avatar
    • is_only_invited `` *(bool)* - ``true if user has not signed up
    • what_i_do (string)
    • skype_username (string)
    • phone_number (string)
  • organization (int) - organization id
  • event organization.joined
  • time (string) - ISO8601 timestamp
Return type:Object
name = 'joined'
ns = 'organization'
class accounts.events.LeftOrganization(dt, user, organization)
Returns:
  • user (int) - user id
  • organization (int) - organization id
  • event organization.left
  • time (string) - ISO8601 timestamp
Return type:Object
name = 'left'
ns = 'organization'
pubsub_channel_template = 'organization:{organization}'
class accounts.events.StatusChange(user_or_id, status)
Returns:
  • status (int) - presence status within the organization
    • 0 Offline
    • 16 Online
  • user (int) - user id
  • event user.status
  • time (string) - ISO8601 timestamp
Return type:Object
name = 'status'
ns = 'user'
class accounts.events.UpdatedMembership(membership)
Returns:
  • membership (Object) - membership object
    • user (int) - user id
    • deleted (string) - ISO8601 timestamp
    • organization (int) - organization id
    • role (int) - role within organization:
      • 0: regular user
      • 1: admin
      • 2: organization owner
    • title (string)
  • event membership.updated
  • time (string) - ISO8601 timestamp
Return type:Object
name = 'updated'
ns = 'membership'
class accounts.events.UpdatedOrganization(organization)

Gets fired when somebody changes the organization settings.

Returns:
  • organization (Object) - organization object
    • id (int) - organization id
    • name (string)
    • subdomain (string)
    • logo (string) - URL to the organization’s logo, if set
    • custom_emojis (Object) - emoji-name (string) –> image-url (string)
    • inviter_role
    • message_edit_timeout (int)
Return type:Object
name = 'updated'
ns = 'organization'
class accounts.events.UpdatedUser(user)
Returns:
  • user (Object) - user object
    • id (int) - user ID
    • username (string)
    • firstName (string)
    • lastName (string)
    • displayName (string)
    • email (string)
    • avatar (string) - URL to the user’s avatar
    • is_only_invited `` *(bool)* - ``true if user has not signed up
    • what_i_do (string)
    • skype_username (string)
    • phone_number (string)
  • event user.updated
  • time (string) - ISO8601 timestamp
Return type:Object
name = 'updated'
ns = 'user'

Chat

class chat.events.Joined(channel_or_id, dt, user_or_id)
name = 'joined'
ns = 'channel'
class chat.events.Left(channel, user)
name = 'left'
ns = 'channel'
class chat.events.Mentioned(msg)
name = 'mentioned'
ns = 'user'
class chat.events.NewChannel(channel)
name = 'new'
ns = 'channel'
class chat.events.NewMessage(message, organization)
Returns:
  • all message fields, see get_history()
  • event message.new
  • time (string) - ISO8601 timestamp
Return type:Object
name = 'new'
ns = 'message'
class chat.events.NewOTRChannel(channel_data, creator)
name = 'new'
ns = 'channel'
class chat.events.OTRMessage(dt=None, **kwargs)
name = 'message'
ns = 'otr'
class chat.events.PinsChanged(dt=None, **kwargs)
name = 'changed'
ns = 'pins'
class chat.events.Read(user_id, msg_id, channel_id)
Returns:
  • message (int) - message id
  • user (int) - user id
  • channel (int) - channel id
  • event channel.read
  • time (string) - ISO8601 timestamp
Return type:Object
name = 'read'
ns = 'channel'
class chat.events.RemovedChannel(channel)
name = 'removed'
ns = 'channel'
class chat.events.RemovedMessage(message)
Returns:
  • id (int) - message id
  • channel (int) - channel id
  • event message.removed
  • message_time (string) - ISO8601 timestamp of original message
  • time (string) - ISO8601 timestamp
Return type:Object
name = 'removed'
ns = 'message'
class chat.events.Typing(channel, user, typing)
Returns:
  • user (int) - user id - deprecated - this field may be removed by 01.08.2018
  • user_data (object)
    • avatar (string) - the URL for the typing user’s avatar image
    • display_name (string)
    • first_name (string)
    • type (string) - ‘user’ is the only option here for now
    • id (int) - typing user’s ID
  • channel (int) - channel id
  • typing (bool)
  • event channel.typing
  • time (string) - ISO8601 timestamp
Return type:Object
name = 'typing'
ns = 'channel'
class chat.events.UpdatedChannel(channel)
name = 'updated'
ns = 'channel'
class chat.events.UpdatedMessage(message, organization)
Returns:
  • all message fields, see get_history()
  • event message.updated
  • time (string) - ISO8601 timestamp
Return type:Object
name = 'updated'
ns = 'message'

Instant

class instant.events.Event(dt=None, **kwargs)
can_publish()
name = None
ns = None
publish()
pubsub_channel_template = None
serialize()

Notifications

class notifications.events.NewNotification(dt=None, **kwargs)
name = 'new'
ns = 'notification'
serialize()