Object (Gateway events)

discord_http.gateway.object module

class discord_http.gateway.object.AutomodExecution(*, state: DiscordAPI, guild: PartialGuild | Guild, channel: PartialChannel | None, user: Member | PartialMember, data: dict)[source]

Bases: object

property rule: PartialAutoModRule

Returns a partial object of automod rule

Type:

PartialAutoModRule

class discord_http.gateway.object.BulkDeletePayload(*, state: DiscordAPI, data: dict, guild: PartialGuild, channel: BaseChannel | PartialChannel)[source]

Bases: object

class discord_http.gateway.object.ChannelPinsUpdate(channel: BaseChannel | PartialChannel, last_pin_timestamp: datetime | None, guild: PartialGuild | Guild | None)[source]

Bases: object

Represents a channel pins update event.

channel

The channel the pins were updated in.

Type:

BaseChannel | PartialChannel

last_pin_timestamp

The last time a pin was updated in the channel.

Type:

datetime | None

guild

The guild the channel is in. If the channel is a DM channel, this will be None.

Type:

PartialGuild | Guild | None

class discord_http.gateway.object.GuildJoinRequest(*, state: DiscordAPI, guild: Guild | PartialGuild, data: dict)[source]

Bases: object

class discord_http.gateway.object.PlayingStatus(*, name: str | None = None, status: StatusType | str | int | None = None, type: ActivityType | str | int | None = None, url: str | None = None)[source]

Bases: object

to_dict() dict[source]
class discord_http.gateway.object.PollVoteEvent(*, state: DiscordAPI, user: Member | PartialMember | PartialUser, channel: PartialChannel, guild: PartialGuild | None, type: PollVoteActionType, data: dict)[source]

Bases: object

class discord_http.gateway.object.Presence(*, state: DiscordAPI, user: Member | PartialMember, guild: PartialGuild | Guild, data: dict)[source]

Bases: object

class discord_http.gateway.object.Reaction(*, state: DiscordAPI, data: dict)[source]

Bases: object

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.

Type:

BaseChannel | PartialChannel

property guild: Guild | PartialGuild | None

The guild the message was sent in

Type:

PartialGuild | None

property message: PartialMessage | None

Returns the message if a message_id is available

Type:

PartialMessage | None

class discord_http.gateway.object.ThreadListSyncPayload(*, state: DiscordAPI, data: ThreadListSync)[source]

Bases: object

Represents a thread list sync payload.

guild_id

The guild ID the threads are in.

Type:

int

channel_ids

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.

Type:

list`[`int]

property channels: list[PartialChannel]
combined() Iterator[tuple[PartialChannel, tuple[Thread, list[PartialThreadMember]]]][source]
property guild: PartialGuild
property members: list[PartialThreadMember]
property threads: list[Thread]
class discord_http.gateway.object.ThreadMembersUpdatePayload(*, state: DiscordAPI, data: ThreadMembersUpdate)[source]

Bases: object

Represents a thread members update’s payload.

id

The ID of the thread.

Type:

int

guild_id

The guild ID the thread is in.

Type:

int

member_count

The total number of members in the thread, capped at 50.

Type:

int

removed_member_ids

The IDs of the members that were removed from the thread.

Type:

list[int]

property added_members: list[ThreadMember]

The members that were added to the thread

Type:

list[PartialThreadMember]

property guild: PartialGuild

The guild the thread is in

Type:

PartialGuild

property removed_members: list[PartialMember]

The members that were removed from the thread

Type:

list[PartialMember]

property thread: PartialChannel | Thread

The thread the members were updated in

Type:

PartialChannel | Thread

class discord_http.gateway.object.TypingStartEvent(*, guild: PartialGuild | Guild | None, channel: BaseChannel | PartialChannel, user: PartialUser | User | Member | PartialMember, timestamp: datetime)[source]

Bases: object

Represents a typing start event.

guild

The guild the typing event was triggered in. If the channel is a DM channel, this will be None.

Type:

PartialGuild | Guild | None

channel

The channel the typing event was triggered in.

Type:

BaseChannel | PartialChannel | None

user

The user that started typing.

Type:

PartialUser | User | Member | PartialMember

timestamp

The time the user started typing.

Type:

datetime