Flag

discord_http.flags module

class discord_http.flags.ApplicationFlags(value)

Bases: BaseFlag

application_auto_moderation_rule_create_badge = 64
gateway_presence = 4096
gateway_presence_limited = 8192
gateway_guild_members = 16384
gateway_guild_members_limited = 32768
verification_pending_guild_limit = 65536
embedded = 131072
gateway_message_content = 262144
gateway_message_content_limited = 524288
application_command_badge = 8388608
classmethod all() Self

Returns a flag with all the flags.

Return type:

Self

classmethod none() Self

Returns a flag with no flags.

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]

Returns a list of all the names of the flag.

to_names() list[str]

Returns the current names of the flag.

Return type:

list[str]

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

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

copy() Self

Returns a copy of the flag.

Return type:

Self

class discord_http.flags.AttachmentFlags(value)

Bases: BaseFlag

clip = 1
thumbnail = 2
remix = 4
classmethod all() Self

Returns a flag with all the flags.

Return type:

Self

classmethod none() Self

Returns a flag with no flags.

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]

Returns a list of all the names of the flag.

to_names() list[str]

Returns the current names of the flag.

Return type:

list[str]

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

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

copy() Self

Returns a copy of the flag.

Return type:

Self

class discord_http.flags.BaseFlag(value)

Bases: _FlagPyMeta

Base class for all flags.

classmethod all() Self

Returns a flag with all the flags.

Return type:

Self

classmethod none() Self

Returns a flag with no flags.

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]

Returns a list of all the names of the flag.

to_names() list[str]

Returns the current names of the flag.

Return type:

list[str]

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

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

copy() Self

Returns a copy of the flag.

Return type:

Self

class discord_http.flags.ChannelFlags(value)

Bases: BaseFlag

pinned = 2
require_tag = 16
hide_media_download_options = 32768
classmethod all() Self

Returns a flag with all the flags.

Return type:

Self

classmethod none() Self

Returns a flag with no flags.

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]

Returns a list of all the names of the flag.

to_names() list[str]

Returns the current names of the flag.

Return type:

list[str]

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

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

copy() Self

Returns a copy of the flag.

Return type:

Self

class discord_http.flags.GuildInviteFlags(value)

Bases: BaseFlag

is_guest_invite = 1
classmethod all() Self

Returns a flag with all the flags.

Return type:

Self

classmethod none() Self

Returns a flag with no flags.

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]

Returns a list of all the names of the flag.

to_names() list[str]

Returns the current names of the flag.

Return type:

list[str]

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

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

copy() Self

Returns a copy of the flag.

Return type:

Self

class discord_http.flags.GuildMemberFlags(value)

Bases: BaseFlag

did_rejoin = 1
completed_onboarding = 2
bypasses_verification = 4
started_onboarding = 8
is_guest = 16
started_home_actions = 32
completed_home_actions = 64
automod_quarantined_username = 128
dm_settings_upsell_acknowledged = 512
classmethod all() Self

Returns a flag with all the flags.

Return type:

Self

classmethod none() Self

Returns a flag with no flags.

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]

Returns a list of all the names of the flag.

to_names() list[str]

Returns the current names of the flag.

Return type:

list[str]

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

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

copy() Self

Returns a copy of the flag.

Return type:

Self

class discord_http.flags.MessageFlags(value)

Bases: BaseFlag

crossposted = 1
is_crosspost = 2
suppress_embeds = 4
source_message_deleted = 8
urgent = 16
has_thread = 32
ephemeral = 64
loading = 128
failed_to_mention_some_roles_in_thread = 256
suppress_notifications = 4096
is_voice_message = 8192
is_components_v2 = 32768
classmethod all() Self

Returns a flag with all the flags.

Return type:

Self

classmethod none() Self

Returns a flag with no flags.

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]

Returns a list of all the names of the flag.

to_names() list[str]

Returns the current names of the flag.

Return type:

list[str]

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

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

copy() Self

Returns a copy of the flag.

Return type:

Self

class discord_http.flags.PermissionOverwrite(target, *, allow=None, deny=None, target_type=None)

Bases: object

Parameters:
allow
deny
target
target_type
is_role() bool

Returns whether the overwrite is a role overwrite.

Return type:

bool

is_member() bool

Returns whether the overwrite is a member overwrite.

Return type:

bool

classmethod from_dict(data) Self

Create a permission overwrite from a dictionary.

Parameters:

data (dict) – The dictionary to create the permission overwrite from

Return type:

Self

Returns:

The permission overwrite

to_dict() dict

Returns the permission overwrite as a dictionary.

Return type:

dict

copy() Self

Returns a copy of the flag.

Return type:

Self

class discord_http.flags.Permissions(value)

Bases: BaseFlag

create_instant_invite = 1
kick_members = 2
ban_members = 4
administrator = 8
manage_channels = 16
manage_guild = 32
add_reactions = 64
view_audit_log = 128
priority_speaker = 256
stream = 512
view_channel = 1024
send_messages = 2048
send_tts_messages = 4096
manage_messages = 8192
attach_files = 32768
read_message_history = 65536
mention_everyone = 131072
use_external_emojis = 262144
view_guild_insights = 524288
connect = 1048576
speak = 2097152
mute_members = 4194304
deafen_members = 8388608
move_members = 16777216
use_vad = 33554432
change_nickname = 67108864
manage_nicknames = 134217728
manage_roles = 268435456
manage_webhooks = 536870912
manage_guild_expressions = 1073741824
use_application_commands = 2147483648
request_to_speak = 4294967296
manage_events = 8589934592
manage_threads = 17179869184
create_public_threads = 34359738368
create_private_threads = 68719476736
use_external_stickers = 137438953472
send_messages_in_threads = 274877906944
use_embedded_activities = 549755813888
moderate_members = 1099511627776
view_creator_monetization_analytics = 2199023255552
use_soundboard = 4398046511104
create_guild_expressions = 8796093022208
create_events = 17592186044416
use_external_sounds = 35184372088832
send_voice_messages = 70368744177664
set_voice_channel_status = 281474976710656
send_polls = 562949953421312
use_external_apps = 1125899906842624
handle_overwrite(allow, deny) Permissions

Handles the overwrite of permissions.

Parameters:
  • allow (int) – The permission flag integer to allow

  • deny (int) – The permission flag integer to deny

Return type:

Permissions

Returns:

The permissions with the overwrite applied

classmethod all() Self

Returns a flag with all the flags.

Return type:

Self

classmethod none() Self

Returns a flag with no flags.

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]

Returns a list of all the names of the flag.

to_names() list[str]

Returns the current names of the flag.

Return type:

list[str]

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

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

copy() Self

Returns a copy of the flag.

Return type:

Self

class discord_http.flags.SKUFlags(value)

Bases: BaseFlag

available = 4
guild_subscription = 128
user_subscription = 256
classmethod all() Self

Returns a flag with all the flags.

Return type:

Self

classmethod none() Self

Returns a flag with no flags.

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]

Returns a list of all the names of the flag.

to_names() list[str]

Returns the current names of the flag.

Return type:

list[str]

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

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

copy() Self

Returns a copy of the flag.

Return type:

Self

class discord_http.flags.SystemChannelFlags(value)

Bases: BaseFlag

suppress_join_notifications = 1
suppress_premium_subscriptions = 2
suppress_guild_reminder_notifications = 4
suppress_join_notification_replies = 8
suppress_role_subscription_purchase_notifications = 16
suppress_role_subscription_purchase_notifications_replies = 32
classmethod all() Self

Returns a flag with all the flags.

Return type:

Self

classmethod none() Self

Returns a flag with no flags.

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]

Returns a list of all the names of the flag.

to_names() list[str]

Returns the current names of the flag.

Return type:

list[str]

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

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

copy() Self

Returns a copy of the flag.

Return type:

Self

class discord_http.flags.UserFlags(value)

Bases: BaseFlag

staff = 1
partner = 2
hypesquad = 4
bug_hunter_level_1 = 8
hypesquad_online_house_1 = 64
hypesquad_online_house_2 = 128
hypesquad_online_house_3 = 256
premium_early_supporter = 512
team_pseudo_user = 1024
bug_hunter_level_2 = 16384
verified_bot = 65536
verified_developer = 131072
certified_moderator = 262144
bot_http_interactions = 524288
spammer = 1048576
active_developer = 4194304
provisional_account = 8388608
classmethod all() Self

Returns a flag with all the flags.

Return type:

Self

classmethod none() Self

Returns a flag with no flags.

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]

Returns a list of all the names of the flag.

to_names() list[str]

Returns the current names of the flag.

Return type:

list[str]

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

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

copy() Self

Returns a copy of the flag.

Return type:

Self