Object (Gateway events)¶
discord_http.gateway.object module¶
- class discord_http.gateway.object.AutomodExecution(*, state, guild, channel, user, data)¶
Bases:
objectRepresents an automod execution event.
- Parameters:
state (DiscordAPI)
guild (PartialGuild | Guild)
channel (PartialChannel | None)
user (Member | PartialMember)
data (dict)
- action: AutoModRuleAction¶
The action that was taken by the automod rule.
- rule_trigger_type: AutoModRuleTriggerType¶
The trigger type of the automod rule that was triggered.
- guild: Guild | PartialGuild¶
The guild the automod execution was triggered in.
- channel: PartialChannel | None¶
The channel the automod execution was triggered in, if applicable.
- user: Member | PartialMember¶
The user that triggered the automod execution.
- alert_system_message_id: int | None¶
The ID of the system message that was sent as an alert for the automod execution, if applicable.
- matched_content: str | None¶
The content that matched the keyword and triggered the automod execution, if applicable.
- property rule: PartialAutoModRule¶
Returns a partial object of automod rule.
- rejection_reason¶
- class discord_http.gateway.object.BulkDeletePayload(*, state, data, guild, channel)¶
Bases:
objectRepresents a bulk delete event.
- Parameters:
state (DiscordAPI)
data (dict)
guild (PartialGuild)
channel (BaseChannel | PartialChannel)
- guild: Guild | PartialGuild¶
The guild the messages were deleted in.
- channel: BaseChannel | PartialChannel¶
The channel the messages were deleted in.
- messages: list[PartialMessage]¶
The messages that were deleted.
- class discord_http.gateway.object.ChannelPinsUpdate(channel, last_pin_timestamp, guild)¶
Bases:
objectRepresents a channel pins update event.
- Parameters:
channel (BaseChannel | PartialChannel)
last_pin_timestamp (datetime | None)
guild (PartialGuild | Guild | None)
- channel: BaseChannel | PartialChannel¶
The channel the pins were updated in.
- guild: PartialGuild | Guild | None¶
The guild the channel is in. If the channel is a DM channel, this will be None.
- class discord_http.gateway.object.GuildJoinRequest(*, state, guild, data)¶
Bases:
objectRepresents a guild join request event.
- Parameters:
state (DiscordAPI)
guild (Guild | PartialGuild)
data (dict)
- guild: Guild | PartialGuild¶
The guild the join request was made to.
- class discord_http.gateway.object.PlayingStatus(*, name=None, status=None, type=None, url=None)¶
Bases:
objectRepresents the playing status of the bot.
- Parameters:
name (str | None)
status (StatusType | str | int | None)
type (ActivityType | str | int | None)
url (str | None)
- name¶
The name of the activity, if any.
- status: StatusType | str | int | None¶
The status of the activity, if any.
- type: ActivityType | str | int | None¶
The type of the activity, if any.
- url¶
The url of the activity, if any. Only applicable for streaming activities.
- class discord_http.gateway.object.PollVoteEvent(*, state, user, channel, guild, type, data)¶
Bases:
objectRepresents a poll vote event.
- Parameters:
state (DiscordAPI)
user (Member | PartialMember | PartialUser)
channel (PartialChannel)
guild (PartialGuild | None)
type (PollVoteActionType)
data (dict)
- user: Member | PartialMember | PartialUser¶
The user that made the vote.
- guild: PartialGuild | None¶
The guild the poll is in. If the poll is in a DM channel, this will be None.
- channel: PartialChannel¶
The channel the poll is in.
- message: PartialMessage¶
The message the poll is in.
- type: PollVoteActionType¶
The type of the poll vote action, either “vote” or “unvote”.
- class discord_http.gateway.object.Presence(*, state, user, guild, data)¶
Bases:
objectRepresents a presence update event.
- Parameters:
state (DiscordAPI)
user (Member | PartialMember)
guild (PartialGuild | Guild)
data (dict)
- user¶
The user the presence update is for.
- guild¶
The guild the presence update is for.
- status: StatusType¶
The status of the presence update.
- desktop: StatusType | None¶
The desktop status of the presence update, if applicable.
- mobile: StatusType | None¶
The mobile status of the presence update, if applicable.
- web: StatusType | None¶
The web status of the presence update, if applicable.
- type¶
- class discord_http.gateway.object.Reaction(*, state, data)¶
Bases:
objectRepresents a reaction event.
- Parameters:
state (DiscordAPI)
data (dict)
- id¶
- guild_id: int | None¶
The ID of the guild the reaction was made in, or None if the reaction was made in a DM channel.
- message_author_id: int | None¶
The ID of the user that authored the message the reaction was made to, or None if the message author is not available.
- emoji: EmojiParser¶
The emoji that was reacted with.
- type: ReactionType¶
The type of the reaction.
- property guild: Guild | PartialGuild | None¶
The guild the message was sent in.
- property channel: PartialChannel | None¶
Returns the channel the message was sent in.
If guild and channel cache is enabled, it can also return full channel object.
- property message: PartialMessage | None¶
Returns the message if a message_id is available.
- class discord_http.gateway.object.ThreadListSyncPayload(*, state, data)¶
Bases:
objectRepresents a thread list sync payload.
- Parameters:
state (DiscordAPI)
data (dict)
- channel_ids: list[int]¶
The parent channel IDs whose threads are being synced. If this is empty, it means all threads in the guild are being synced. This may contains ids of channels that have no active threads.
- property guild: PartialGuild¶
The guild the thread is in.
- property channels: list[PartialChannel]¶
The channels in the thread list.
- class discord_http.gateway.object.ThreadMembersUpdatePayload(*, state, data)¶
Bases:
objectRepresents a thread members update’s payload.
- Parameters:
state (DiscordAPI)
data (dict)
- property guild: PartialGuild¶
The guild the thread is in.
- property thread: PartialChannel | Thread¶
The thread the members were updated in.
- property added_members: list[ThreadMember]¶
The members that were added to the thread.
- Type:
list[PartialThreadMember]
- property removed_members: list[PartialMember]¶
The members that were removed from the thread.
- Type:
- class discord_http.gateway.object.TypingStartEvent(*, guild, channel, user, timestamp)¶
Bases:
objectRepresents a typing start event.
- Parameters:
guild (PartialGuild | Guild | None)
channel (BaseChannel | PartialChannel)
user (PartialUser | User | Member | PartialMember)
timestamp (datetime)
- guild: PartialGuild | Guild | None¶
The guild the typing event was triggered in. If the channel is a DM channel, this will be None.
- channel: BaseChannel | PartialChannel¶
The channel the typing event was triggered in.
- user: PartialUser | User | Member | PartialMember¶
The user that started typing.