Flags

discord_http.gateway.flags module

class discord_http.gateway.flags.ActivityFlags(value=0)

Bases: BaseFlag

Represents the flags of a gateway presence activity.

Parameters:

value (int)

Return type:

Self

instance = <ActivityFlags.instance: 1>
join = <ActivityFlags.join: 2>
spectate = <ActivityFlags.spectate: 4>
join_request = <ActivityFlags.join_request: 8>
sync = <ActivityFlags.sync: 16>
play = <ActivityFlags.play: 32>
party_privacy_friends = <ActivityFlags.party_privacy_friends: 64>
party_privacy_voice_channel = <ActivityFlags.party_privacy_voice_channel: 128>
embedded = <ActivityFlags.embedded: 256>
add_flags(*flag_name) → Self

Add a flag by name.

Parameters:

*flag_name (Union[Self, str]) – The flag to add

Return type:

Self

Returns:

The flag with the added flag

Raises:

ValueError – The flag name is not a valid flag

classmethod all() → Self

Returns a flag with all the flags.

Return type:

Self

copy() → Self

Returns a copy of the flag.

Return type:

Self

classmethod from_names(*args) → Self

Create a flag from names.

Parameters:

*args (str) – The names of the flags to create

Return type:

Self

Returns:

The flag with the added flags

Raises:

ValueError – The flag name is not a valid flag

property list_names: list[str]

A list of all the names of the flag.

property name: str | None

The name of the flag, or the |-joined names if it’s a combination.

classmethod none() → Self

Returns a flag with no flags.

Return type:

Self

property pretty_name: str

A pretty name for the flag.

remove_flags(*flag_name) → Self

Remove a flag by name.

Parameters:

flag_name (Union[Self, str]) – The flag to remove

Return type:

Self

Returns:

The flag with the removed flag

Raises:

ValueError – The flag name is not a valid flag

to_names() → list[str]

Returns the current names of the flag.

Return type:

list[str]

value
class discord_http.gateway.flags.GatewayCacheFlags(value=0)

Bases: BaseFlag

Represents what the gateway should cache.

Parameters:

value (int)

Return type:

Self

partial_guilds = <GatewayCacheFlags.partial_guilds: 1>
partial_members = <GatewayCacheFlags.partial_members: 2>
partial_channels = <GatewayCacheFlags.partial_channels: 4>
partial_threads = <GatewayCacheFlags.partial_threads: 8>
partial_roles = <GatewayCacheFlags.partial_roles: 16>
partial_emojis = <GatewayCacheFlags.partial_emojis: 32>
partial_stickers = <GatewayCacheFlags.partial_stickers: 64>
partial_voice_states = <GatewayCacheFlags.partial_voice_states: 128>
guilds = <GatewayCacheFlags.guilds: 1125899906842624>
members = <GatewayCacheFlags.members: 2251799813685248>
channels = <GatewayCacheFlags.channels: 4503599627370496>
threads = <GatewayCacheFlags.threads: 9007199254740992>
roles = <GatewayCacheFlags.roles: 18014398509481984>
emojis = <GatewayCacheFlags.emojis: 36028797018963968>
stickers = <GatewayCacheFlags.stickers: 72057594037927936>
voice_states = <GatewayCacheFlags.voice_states: 144115188075855872>
presences = <GatewayCacheFlags.presences: 1267650600228229401496703205376>
add_flags(*flag_name) → Self

Add a flag by name.

Parameters:

*flag_name (Union[Self, str]) – The flag to add

Return type:

Self

Returns:

The flag with the added flag

Raises:

ValueError – The flag name is not a valid flag

classmethod all() → Self

Returns a flag with all the flags.

Return type:

Self

copy() → Self

Returns a copy of the flag.

Return type:

Self

classmethod from_names(*args) → Self

Create a flag from names.

Parameters:

*args (str) – The names of the flags to create

Return type:

Self

Returns:

The flag with the added flags

Raises:

ValueError – The flag name is not a valid flag

property list_names: list[str]

A list of all the names of the flag.

property name: str | None

The name of the flag, or the |-joined names if it’s a combination.

classmethod none() → Self

Returns a flag with no flags.

Return type:

Self

property pretty_name: str

A pretty name for the flag.

remove_flags(*flag_name) → Self

Remove a flag by name.

Parameters:

flag_name (Union[Self, str]) – The flag to remove

Return type:

Self

Returns:

The flag with the removed flag

Raises:

ValueError – The flag name is not a valid flag

to_names() → list[str]

Returns the current names of the flag.

Return type:

list[str]

value
class discord_http.gateway.flags.GatewayCapabilities(value=0)

Bases: BaseFlag

Represents the opt-in capabilities bitfield sent in the Gateway Identify payload.

Parameters:

value (int)

Return type:

Self

private_channel_obfuscation = <GatewayCapabilities.private_channel_obfuscation: 32768>
add_flags(*flag_name) → Self

Add a flag by name.

Parameters:

*flag_name (Union[Self, str]) – The flag to add

Return type:

Self

Returns:

The flag with the added flag

Raises:

ValueError – The flag name is not a valid flag

classmethod all() → Self

Returns a flag with all the flags.

Return type:

Self

copy() → Self

Returns a copy of the flag.

Return type:

Self

classmethod from_names(*args) → Self

Create a flag from names.

Parameters:

*args (str) – The names of the flags to create

Return type:

Self

Returns:

The flag with the added flags

Raises:

ValueError – The flag name is not a valid flag

property list_names: list[str]

A list of all the names of the flag.

property name: str | None

The name of the flag, or the |-joined names if it’s a combination.

classmethod none() → Self

Returns a flag with no flags.

Return type:

Self

property pretty_name: str

A pretty name for the flag.

remove_flags(*flag_name) → Self

Remove a flag by name.

Parameters:

flag_name (Union[Self, str]) – The flag to remove

Return type:

Self

Returns:

The flag with the removed flag

Raises:

ValueError – The flag name is not a valid flag

to_names() → list[str]

Returns the current names of the flag.

Return type:

list[str]

value
class discord_http.gateway.flags.Intents(value=0)

Bases: BaseFlag

Represents the gateway intents for the bot.

Parameters:

value (int)

Return type:

Self

guilds = <Intents.guilds: 1>
guild_members = <Intents.guild_members: 2>
guild_moderation = <Intents.guild_moderation: 4>
guild_expressions = <Intents.guild_expressions: 8>
guild_integrations = <Intents.guild_integrations: 16>
guild_webhooks = <Intents.guild_webhooks: 32>
guild_invites = <Intents.guild_invites: 64>
guild_voice_states = <Intents.guild_voice_states: 128>
guild_presences = <Intents.guild_presences: 256>
guild_messages = <Intents.guild_messages: 512>
guild_message_reactions = <Intents.guild_message_reactions: 1024>
guild_message_typing = <Intents.guild_message_typing: 2048>
direct_messages = <Intents.direct_messages: 4096>
direct_message_reactions = <Intents.direct_message_reactions: 8192>
direct_message_typing = <Intents.direct_message_typing: 16384>
message_content = <Intents.message_content: 32768>
guild_scheduled_events = <Intents.guild_scheduled_events: 65536>
auto_moderation_configuration = <Intents.auto_moderation_configuration: 1048576>
auto_moderation_execution = <Intents.auto_moderation_execution: 2097152>
guild_message_polls = <Intents.guild_message_polls: 16777216>
direct_message_polls = <Intents.direct_message_polls: 33554432>
add_flags(*flag_name) → Self

Add a flag by name.

Parameters:

*flag_name (Union[Self, str]) – The flag to add

Return type:

Self

Returns:

The flag with the added flag

Raises:

ValueError – The flag name is not a valid flag

classmethod all() → Self

Returns a flag with all the flags.

Return type:

Self

copy() → Self

Returns a copy of the flag.

Return type:

Self

classmethod from_names(*args) → Self

Create a flag from names.

Parameters:

*args (str) – The names of the flags to create

Return type:

Self

Returns:

The flag with the added flags

Raises:

ValueError – The flag name is not a valid flag

property list_names: list[str]

A list of all the names of the flag.

property name: str | None

The name of the flag, or the |-joined names if it’s a combination.

classmethod none() → Self

Returns a flag with no flags.

Return type:

Self

property pretty_name: str

A pretty name for the flag.

remove_flags(*flag_name) → Self

Remove a flag by name.

Parameters:

flag_name (Union[Self, str]) – The flag to remove

Return type:

Self

Returns:

The flag with the removed flag

Raises:

ValueError – The flag name is not a valid flag

to_names() → list[str]

Returns the current names of the flag.

Return type:

list[str]

value