Events¶
The following section documents everything related to events.
Models¶
Events¶
BaseEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.BaseEvent(*, is_canceled=False)[source]¶
Base class for all events.
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- uncancel()[source]¶
Uncancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
BaseChannelCreateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.BaseChannelCreateEvent(*, is_canceled=False, shard)[source]¶
Base class for events when a channel is created.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
PrivateChannelCreateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.PrivateChannelCreateEvent(*, is_canceled=False, shard, channel)[source]¶
Bases:
BaseChannelCreateEventDispatched when the user created a DM, or started participating in group.
This inherits from
BaseChannelCreateEvent.- channel¶
The joined DM or group channel.
- Type:
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
ServerChannelCreateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.ServerChannelCreateEvent(*, is_canceled=False, shard, channel)[source]¶
Bases:
BaseChannelCreateEventDispatched when the channel is created in server or became accessible to the connected user.
This inherits from
BaseChannelCreateEvent.- channel¶
The created server channel.
- Type:
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
ChannelCreateEvent¶
- class stoat.ChannelCreateEvent¶
An union of private/server channel create events.
The following classes are included in this union:
ChannelUpdateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.ChannelUpdateEvent(*, is_canceled=False, shard, channel, before, after)[source]¶
Dispatched when the channel is updated.
This inherits from
ShardEvent.- channel¶
The fields that were updated.
- Type:
- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContextType,ChannelUpdateEventCacheContext]
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
ChannelDeleteEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.ChannelDeleteEvent(*, is_canceled=False, shard, channel_id, channel)[source]¶
Dispatched when the server channel or group is deleted or became inaccessible for the connected user.
This inherits from
ShardEvent.- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,ChannelDeleteEventCacheContext]
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
GroupRecipientAddEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.GroupRecipientAddEvent(*, is_canceled=False, shard, channel_id, user_id, group)[source]¶
Dispatched when recipient is added to the group.
This inherits from
ShardEvent.- group¶
The group in cache (in previous state as it had no recipient), if available.
- Type:
Optional[
GroupChannel]
- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,GroupRecipientAddEventCacheContext]
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
GroupRecipientRemoveEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.GroupRecipientRemoveEvent(*, is_canceled=False, shard, channel_id, user_id, group)[source]¶
Dispatched when recipient is removed from the group.
This inherits from
ShardEvent.- group¶
The group in cache (in previous state as it had recipient), if available.
- Type:
Optional[
GroupChannel]
- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,GroupRecipientRemoveEventCacheContext]
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
ChannelStartTypingEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.ChannelStartTypingEvent(*, is_canceled=False, shard, channel_id, user_id)[source]¶
Dispatched when someone starts typing in a channel.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
ChannelStopTypingEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.ChannelStopTypingEvent(*, is_canceled=False, shard, channel_id, user_id)[source]¶
Dispatched when someone stopped typing in a channel.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
MessageStartEditingEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.MessageStartEditingEvent(*, is_canceled=False, shard, channel_id, message_id, user_id)[source]¶
Dispatched when someone starts editing a message.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
MessageStopEditingEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.MessageStopEditingEvent(*, is_canceled=False, shard, channel_id, message_id, user_id)[source]¶
Dispatched when someone stops editing a message.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
MessageAckEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.MessageAckEvent(*, is_canceled=False, shard, channel_id, message_id, user_id)[source]¶
Dispatched when the connected user acknowledges the message in a channel (usually from remote device).
This inherits from
ShardEvent.- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
MessageCreateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.MessageCreateEvent(*, is_canceled=False, shard, message)[source]¶
Dispatched when someone sends message in a channel.
This inherits from
ShardEvent.- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
MessageUpdateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.MessageUpdateEvent(*, is_canceled=False, shard, message, before, after)[source]¶
Dispatched when the message is updated.
This inherits from
ShardEvent.- message¶
The fields that were updated.
- Type:
- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,MessageUpdateEventCacheContext]
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
MessageAppendEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.MessageAppendEvent(*, is_canceled=False, shard, data, message)[source]¶
Dispatched when embeds are appended to the message.
This inherits from
ShardEvent.- data¶
The data that got appended to message.
- Type:
- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,MessageAppendEventCacheContext]
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
MessageDeleteEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.MessageDeleteEvent(*, is_canceled=False, shard, channel_id, message_id, message)[source]¶
Dispatched when the message is deleted in channel.
This inherits from
ShardEvent.- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,MessageDeleteEventCacheContext]
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
MessageReactEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.MessageReactEvent(cache_context=NOTHING, *, is_canceled=False, shard, channel_id, message_id, user_id, emoji, message)[source]¶
Dispatched when someone reacts to message.
This inherits from
ShardEvent.- cache_context¶
The cache context used.
- Type:
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
MessageUnreactEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.MessageUnreactEvent(*, is_canceled=False, shard, channel_id, message_id, user_id, emoji, message)[source]¶
Dispatched when someone removes their reaction from message.
This inherits from
ShardEvent.- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,MessageUnreactEventCacheContext]
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
MessageClearReactionEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.MessageClearReactionEvent(*, is_canceled=False, shard, channel_id, message_id, emoji, message)[source]¶
Dispatched when reactions for specific emoji are removed from message.
This inherits from
ShardEvent.- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,MessageClearReactionEventCacheContext]
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
MessageDeleteBulkEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.MessageDeleteBulkEvent(*, is_canceled=False, shard, channel_id, message_ids, messages)[source]¶
Dispatched when multiple messages are deleted from channel.
This inherits from
ShardEvent.- messages¶
The list of deleted messages, potentially retrieved from cache.
Unlike
message_ids, some messages are not guaranteed to be here.- Type:
List[
Message]
- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,MessageDeleteBulkEventCacheContext]
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
ServerCreateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.ServerCreateEvent(*, is_canceled=False, shard, joined_at, server, emojis, voice_states)[source]¶
Dispatched when the server is created, or client joined server.
This inherits from
ShardEvent.- joined_at¶
When the client got added to server, generated locally, and used internally.
- Type:
- emojis¶
The server emojis.
- Type:
List[
ServerEmoji]
- voice_states¶
The voice states of the text/voice channels in the server.
- Type:
- cache_context¶
The cache context used.
- Type:
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
ServerEmojiCreateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.ServerEmojiCreateEvent(*, is_canceled=False, shard, emoji)[source]¶
Dispatched when emoji is created in server.
This inherits from
ShardEvent.- emoji¶
The created emoji.
- Type:
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
ServerEmojiDeleteEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.ServerEmojiDeleteEvent(*, is_canceled=False, shard, server_id, emoji_id, emoji)[source]¶
Dispatched when emoji is deleted from the server.
This inherits from
ShardEvent.- emoji¶
The deleted emoji object, if available.
- Type:
Optional[
ServerEmoji]
- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,ServerEmojiDeleteEventCacheContext]
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
ServerUpdateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.ServerUpdateEvent(*, is_canceled=False, shard, server, before, after)[source]¶
Dispatched when the server details are updated.
This inherits from
ShardEvent.- server¶
The fields that were updated.
- Type:
- cache_context¶
The cache context used.
- Type:
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
ServerDeleteEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.ServerDeleteEvent(*, is_canceled=False, shard, server_id, server)[source]¶
Dispatched when the server is deleted.
This inherits from
ShardEvent.- cache_context¶
The cache context used.
- Type:
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
ServerMemberJoinEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.ServerMemberJoinEvent(*, is_canceled=False, shard, member)[source]¶
Dispatched when the user got added to the server.
This inherits from
ShardEvent.- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,ServerMemberJoinEventCacheContext]
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
ServerMemberUpdateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.ServerMemberUpdateEvent(*, is_canceled=False, shard, member, before, after)[source]¶
Dispatched when the member details are updated.
This inherits from
ShardEvent.- member¶
The fields that were updated.
- Type:
- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,ServerMemberUpdateEventCacheContext]
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
ServerMemberRemoveEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.ServerMemberRemoveEvent(*, is_canceled=False, shard, server_id, user_id, member, reason)[source]¶
Dispatched when the member (or client user) got removed from server.
This inherits from
ShardEvent.- reason¶
The reason why member was removed.
- Type:
- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,ServerMemberRemoveEventCacheContext]
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
RawServerRoleUpdateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.RawServerRoleUpdateEvent(*, is_canceled=False, shard, role, old_role, new_role, server)[source]¶
Dispatched when the role got created or updated in server.
This inherits from
ShardEvent.- role¶
The fields that got updated.
- Type:
- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,RawServerRoleUpdateEventCacheContext]
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
ServerRoleDeleteEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.ServerRoleDeleteEvent(*, is_canceled=False, shard, server_id, role_id, server, role)[source]¶
Dispatched when the role got deleted from server.
This inherits from
ShardEvent.- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,ServerRoleDeleteEventCacheContext]
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
ServerRoleRanksUpdateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.ServerRoleRanksUpdateEvent(*, is_canceled=False, shard, server_id, role_ids, server)[source]¶
Dispatched when the server role ranks are updated.
This inherits from
ShardEvent.Added in version 1.2.
- role_ids¶
The role’s IDs.
See
ranksparameter onHTTPClient.bulk_edit_role_ranks()for details.- Type:
List[
str]
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- uncancel()[source]¶
Uncancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,ServerRoleRanksUpdateEventCacheContext]
ReportCreateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.ReportCreateEvent(*, is_canceled=False, shard, report)[source]¶
Dispatched when the report was created.
This inherits from
BaseEvent.Warning
This event is not dispatched over WebSocket.
- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- uncancel()[source]¶
Uncancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- report¶
The created report.
- Type:
CreatedReport
UserUpdateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.UserUpdateEvent(*, is_canceled=False, shard, user, before, after)[source]¶
Dispatched when the user details are updated.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- uncancel()[source]¶
Uncancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- user¶
The fields that were updated.
- Type:
- cache_context¶
The cache context used.
- Type:
UserRelationshipUpdateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.UserRelationshipUpdateEvent(*, is_canceled=False, shard, current_user_id, old_user, new_user, before)[source]¶
Dispatched when the relationship with user was updated.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- uncancel()[source]¶
Uncancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- before¶
The old relationship found in cache.
- Type:
Optional[
RelationshipStatus]
- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,UserRelationshipUpdateEventCacheContext]
UserSettingsUpdateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.UserSettingsUpdateEvent(*, is_canceled=False, shard, current_user_id, partial, before, after)[source]¶
Dispatched when the user settings are changed, likely from remote device.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- uncancel()[source]¶
Uncancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- current_user_id¶
The current user ID.
- partial¶
The fields that were updated.
- Type:
- before¶
The settings as they were before being updated.
Note
This is populated properly only if user settings are available.
- Type:
- after¶
The settings as they were updated.
- Type:
UserPlatformWipeEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.UserPlatformWipeEvent(*, is_canceled=False, shard, user_id, raw_flags, before, after)[source]¶
Dispatched when the user has been platform banned or deleted their account.
Clients should remove the following associated data: - DM Channels - Messages - Relationships - Server Memberships
User flags are specified to explain why a wipe is occurring though not all reasons will necessarily ever appear.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- uncancel()[source]¶
Uncancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,UserPlatformWipeEventCacheContext]
WebhookCreateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.WebhookCreateEvent(*, is_canceled=False, shard, webhook)[source]¶
Dispatched when the webhook is created in a channel.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
WebhookUpdateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.WebhookUpdateEvent(*, is_canceled=False, shard, webhook)[source]¶
Dispatched when the webhook details are updated.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- uncancel()[source]¶
Uncancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- webhook¶
The fields that were updated.
- Type:
WebhookDeleteEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.WebhookDeleteEvent(*, is_canceled=False, shard, webhook_id, webhook)[source]¶
Dispatched when the webhook is deleted.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
AuthifierEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.AuthifierEvent(*, is_canceled=False, shard)[source]¶
Dispatched when Authifier-related event happens.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
SessionCreateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.SessionCreateEvent(*, is_canceled=False, shard, session)[source]¶
Bases:
AuthifierEventDispatched when new session is created.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
SessionDeleteEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.SessionDeleteEvent(*, is_canceled=False, shard, current_user_id, session_id)[source]¶
Bases:
AuthifierEventDispatched when session is deleted.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
SessionDeleteAllEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.SessionDeleteAllEvent(*, is_canceled=False, shard, current_user_id, exclude_session_id)[source]¶
Bases:
AuthifierEventDispatched when all sessions are deleted (and optionally except one).
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
LogoutEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.LogoutEvent(*, is_canceled=False, shard)[source]¶
Dispatched when the connected user got logged out.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
VoiceChannelJoinEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.VoiceChannelJoinEvent(*, is_canceled=False, shard, channel_id, state)[source]¶
Dispatched when an user joins a voice channel.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- uncancel()[source]¶
Uncancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- state¶
The user’s voice state.
- Type:
VoiceChannelLeaveEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.VoiceChannelLeaveEvent(*, is_canceled=False, shard, channel_id, user_id, container, state)[source]¶
Dispatched when an user left voice channel.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- uncancel()[source]¶
Uncancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- container¶
The channel’s voice state container.
- Type:
Optional[
ChannelVoiceStateContainer]
- state¶
The user’s voice state.
- Type:
Optional[
UserVoiceState]
- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,VoiceChannelLeaveEventCacheContext]
VoiceChannelMoveEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.VoiceChannelMoveEvent(*, is_canceled=False, shard, user_id, from_, to, old_container, new_container, state)[source]¶
Dispatched when an user is moved from voice channel to another voice channel.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- uncancel()[source]¶
Uncancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- old_container¶
The voice state container for the previous voice channel the user was in.
- Type:
Optional[
ChannelVoiceStateContainer]
- new_container¶
The voice state container for the voice channel the user is in.
- Type:
Optional[
ChannelVoiceStateContainer]
- state¶
The user’s voice state.
- Type:
- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,VoiceChannelMoveEventCacheContext]
UserVoiceStateUpdateEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.UserVoiceStateUpdateEvent(*, is_canceled=False, shard, channel_id, container, state, before, after)[source]¶
Dispatched when an user’s voice state is updated.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- uncancel()[source]¶
Uncancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- container¶
The channel’s voice state container.
- Type:
Optional[
ChannelVoiceStateContainer]
- state¶
The fields that were updated.
- Type:
- before¶
The user’s voice state as it was before being updated, if available.
- Type:
Optional[
UserVoiceState]
- after¶
The user’s voice state as it was updated, if available.
- Type:
Optional[
UserVoiceState]
- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,UserVoiceStateUpdateEventCacheContext]
UserMoveVoiceChannelEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.UserMoveVoiceChannelEvent(*, is_canceled=False, shard, node, from_id, to_id, token)[source]¶
Dispatched when the current user was moved between voice channels and might have potentially reconnect to another node.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- uncancel()[source]¶
Uncancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- node¶
The node’s name to connect to.
- token¶
The token for this node.
- cache_context¶
The cache context used.
- Type:
Union[
UndefinedCacheContext,UserVoiceStateUpdateEventCacheContext]
AuthenticatedEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.AuthenticatedEvent(*, is_canceled=False, shard)[source]¶
Dispatched when the WebSocket was successfully authenticated.
This inherits from
ShardEvent.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
BeforeConnectEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.BeforeConnectEvent(*, is_canceled=False, shard)[source]¶
Dispatched before connection to Stoat WebSocket is made.
This inherits from
ShardEvent.Warning
Similarly to
ReadyEvent, this event may be dispatched multiple times.Consider subclassing
Clientand overridingsetup_hook()if you wish to prepare before starting up.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
AfterConnectEvent¶
- async abefore_dispatch
- async aprocess
- def before_dispatch
- def cancel
- def process
- def set_canceled
- def uncancel
- class stoat.AfterConnectEvent(*, is_canceled=False, shard, socket)[source]¶
Dispatched after connection to Stoat WebSocket is made.
This inherits from
ShardEvent.Warning
Similarly to
ReadyEvent, this event may be dispatched multiple times.Consider subclassing
Clientand overridingsetup_hook()if you wish to prepare before starting up.- await abefore_dispatch()[source]¶
This function is a coroutine.
Asynchronous version of
before_dispatch().
- cancel()[source]¶
Cancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- process()[source]¶
Any: Called when handlers got invoked and temporary subscriptions were handled and removed.
- uncancel()[source]¶
Uncancels the event processing (updating cache).
- Returns:
Whether the event was not canceled before.
- Return type:
- socket¶
The connected WebSocket.
- Type: