Models¶
Our models use the Pydantic module for simple data parsing.
All methods from BaseModel are inherited along with ours.
These methods will not be shown in our docs,
you can find them in the Pydantic documentation.
Application¶
- class acord.models.Application(*, id: acord.models.Snowflake, name: str, icon: str = None, description: str, rpc_origins: List[pydantic.networks.AnyHttpUrl] = None, bot_public: bool, bot_require_code_grant: bool, terms_of_service_url: pydantic.networks.AnyHttpUrl = None, privacy_policy_url: pydantic.networks.AnyHttpUrl = None, owner: dict = None, summary: str, verify_key: str, team: acord.models.application.Team = None, guild_id: acord.models.Snowflake = None, primary_sku_id: acord.models.Snowflake = None, slug: str = None, cover_image: str = None, flags: acord.bases.flags.user.ApplicationFlags = None)[source]¶
-
- bot_require_code_grant: bool¶
when true the app’s bot will only join upon completion of the full oauth2 code grant flow
- flags: Optional[acord.bases.flags.user.ApplicationFlags]¶
the application’s public flags
- guild_id: Optional[acord.models.Snowflake]¶
if this application is a game sold on Discord, this field will be the guild to which it has been linked
- id: acord.models.Snowflake¶
ID of the application
- primary_sku_id: Optional[acord.models.Snowflake]¶
if this application is a game sold on Discord, this field will be the id of the “Game SKU” that is created, if exists
- privacy_policy_url: Optional[pydantic.networks.AnyHttpUrl]¶
the url of the app’s privacy policy
- rpc_origins: Optional[List[pydantic.networks.AnyHttpUrl]]¶
an array of rpc origin urls, if rpc is enabled
- slug: Optional[str]¶
if this application is a game sold on Discord, this field will be the URL slug that links to the store page
- summary: str¶
if this application is a game sold on Discord, this field will be the summary field for the store page of its primary sku
- team: Optional[acord.models.application.Team]¶
if the application belongs to a team, this will be a list of the members of that team
- terms_of_service_url: Optional[pydantic.networks.AnyHttpUrl]¶
the url of the app’s terms of service
Attachment¶
AuditLog¶
- class acord.models.AuditLog(*, conn: Any = None, guild_id: acord.models.Snowflake, audit_log_entries: List[acord.models.audit_logs.AuditLogEntry], guild_scheduled_events: List[acord.models.guild_sched_event.GuildScheduledEvent], integrations: List[acord.models.integrations.PartialIntegration], threads: List[acord.models.channels.thread.Thread], users: List[acord.models.user.User], webhooks: List[acord.webhooks.webhook.Webhook])[source]¶
AuditLogChange¶
- class acord.models.AuditLogChange(*, new_value: Any = None, old_value: Any = None, key: str)[source]¶
If
AuditLogChange.new_value`is not present in the change object, whileAuditLogChange.old_value`is, that means the property that was changed has been reset, or set toNone- new_value: Optional[Any]¶
new value of the key
- old_value: Optional[Any]¶
old value of the key
AuditLogEntry¶
- class acord.models.AuditLogEntry(*, target_id: str = None, changes: List[acord.models.audit_logs.AuditLogChange] = None, user_id: acord.models.Snowflake = None, id: acord.models.Snowflake, action_type: acord.bases.enums.audit_logs.AuditLogEvent, options: acord.models.audit_logs.AuditLogEntryInfo = None, reason: str = None)[source]¶
- action_type: acord.bases.enums.audit_logs.AuditLogEvent¶
type of action made
- changes: Optional[List[acord.models.audit_logs.AuditLogChange]]¶
list of changes made to target
- id: acord.models.Snowflake¶
ID of entry
- options: Optional[acord.models.audit_logs.AuditLogEntryInfo]¶
additional info for certain action types
- target_id: Optional[str]¶
ID of affected entity, can be an ID of anything implementing the
Hashableclass.
- user_id: Optional[acord.models.Snowflake]¶
the user who made changes
Warning
If your attempting to use this value for user who invoked command, you will instead recieve the client.
AuditLogEntryInfo¶
- class acord.models.AuditLogEntryInfo(*, channel_id: acord.models.Snowflake = None, count: int = None, delete_member_days: int = None, id: acord.models.Snowflake = None, members_removed: int = None, message_id: acord.models.Snowflake = None, role_name: str = None, type: str = None)[source]¶
- channel_id: Optional[acord.models.Snowflake]¶
channel in which the entities were targeted
- id: Optional[acord.models.Snowflake]¶
id of the overwritten entity
- message_id: Optional[acord.models.Snowflake]¶
id of the message that was targeted
Ban¶
- class acord.models.Ban(*, reason: str, user: acord.models.user.User)[source]¶
CategoryChannel¶
- class acord.models.CategoryChannel(*, conn: Any = None, id: int, type: acord.bases.flags.channels.ChannelTypes, permission_overwrites: List[acord.bases.permissions_overwrite.PermissionsOverwrite] = [], name: str, nsfw: bool = False, position: int, guild_id: acord.models.Snowflake)[source]¶
-
- permission_overwrites: Optional[List[PermissionsOverwrite]]¶
List of permissions for category
Channel¶
DMChannel¶
- asyncfetch_message
- defget_message
- asyncpins
- asyncsend
- asynctrigger_typing
- class acord.models.DMChannel(*, conn: Any = None, id: int, type: acord.bases.flags.channels.ChannelTypes, last_message_id: acord.models.Snowflake = None, recipients: List[acord.models.user.User])[source]¶
- fetch_message(message_id: Union[acord.models.message.Message, acord.models.Snowflake]) Optional[acord.models.message.Message]¶
This function is a coroutine.
Fetch a message directly from channel/thread
- get_message(message_id: Union[acord.models.message.Message, acord.models.Snowflake]) Optional[acord.models.message.Message]¶
This is a function.
Returns the message stored in the internal cache, may be outdated
- async pins() Iterator[acord.models.message.Message]¶
This function is a coroutine.
Fetches channel/thread pins
- async send(**data) Optional[acord.models.message.Message]¶
This function is a coroutine.
Create a new message in the channel/thread
- Parameters
content (
str) – Message content, must be below2000chars.files (Union[List[:class:`File`], :class:`File`]) – A file or a list of files to be sent. File must not be closed else an error is raised.
message_reference (Union[
MessageReference]) – A message to reply to, client must be able to read messages in the channel/thread.tts (
bool) – Whether this is a TTS messageembeds (Union[List[:class:`Embed`], :class:`File`]) – An embed or a list of embeds to send
components (List[
ActionRow]) –A list of action rows to send, refer to me for a more detailed guide.
Emoji¶
- asyncdelete
- asyncedit
- defis_useable
- class acord.models.Emoji(*, conn: Any = None, id: acord.models.Snowflake, name: str, roles: List[acord.models.roles.Role] = [], user: acord.models.user.User = None, require_colons: bool = None, managed: bool = None, animated: bool = None, available: bool = None, is_unicode: bool = None, guild_id: int = None, deleted: bool = False, created_at: datetime.datetime = None)[source]¶
Reprentation of a discord Emoji
- async delete(*, reason: Optional[str] = None, guild_id: Optional[int]) None[source]¶
This function is a coroutine.
Deletes emoji
- edit(*, name: Optional[str] = None, roles: Optional[List[acord.models.roles.Role]] = None, reason: Optional[str] = None) acord.models.emoji.Emoji[source]¶
This function is a coroutine.
Edits emoji
- created_at: Optional[datetime.datetime]¶
When the emoji was created
- id: acord.models.Snowflake¶
ID of Emoji
- roles: Optional[List[acord.models.roles.Role]]¶
List of roles
- user: Optional[acord.models.user.User]¶
User who created the emoji
GroupDMChannel¶
- asyncfetch_message
- defget_message
- asyncpins
- asyncsend
- asynctrigger_typing
- class acord.models.GroupDMChannel(*, conn: Any = None, id: int, type: acord.bases.flags.channels.ChannelTypes, last_message_id: acord.models.Snowflake = None, recipients: List[acord.models.user.User], icon: pydantic.networks.AnyHttpUrl = None, owner_id: acord.models.Snowflake)[source]¶
- fetch_message(message_id: Union[acord.models.message.Message, acord.models.Snowflake]) Optional[acord.models.message.Message]¶
This function is a coroutine.
Fetch a message directly from channel/thread
- get_message(message_id: Union[acord.models.message.Message, acord.models.Snowflake]) Optional[acord.models.message.Message]¶
This is a function.
Returns the message stored in the internal cache, may be outdated
- async pins() Iterator[acord.models.message.Message]¶
This function is a coroutine.
Fetches channel/thread pins
- async send(**data) Optional[acord.models.message.Message]¶
This function is a coroutine.
Create a new message in the channel/thread
- Parameters
content (
str) – Message content, must be below2000chars.files (Union[List[:class:`File`], :class:`File`]) – A file or a list of files to be sent. File must not be closed else an error is raised.
message_reference (Union[
MessageReference]) – A message to reply to, client must be able to read messages in the channel/thread.tts (
bool) – Whether this is a TTS messageembeds (Union[List[:class:`Embed`], :class:`File`]) – An embed or a list of embeds to send
components (List[
ActionRow]) –A list of action rows to send, refer to me for a more detailed guide.
- async trigger_typing() None¶
This function is a coroutine.
Creates a typing indicator in this channel/thread.
- icon: Optional[AnyHttpUrl]¶
Icon of the group DM
Guild¶
- afk_channel_id
- afk_timeout
- application_id
- banner
- channels
- created_at
- default_message_notifications
- description
- emojis
- explicit_content_filter
- features
- guild_scheduled_events
- icon
- id
- joined_at
- large
- max_members
- max_video_channel_users
- member_count
- members
- mfa_level
- name
- nsfw
- nsfw_level
- owner_id
- preferred_locale
- premium_progress_bar_enabled
- premium_subscription_count
- premium_tier
- presences
- public_updates_channel_id
- roles
- rules_channel_id
- splash
- stage_instances
- stickers
- system_channel_flags
- system_channel_id
- threads
- unavailable
- vanity_url_code
- verification_level
- voice_states
- clsGuild.create
- clsGuild.create_from_template
- asyncadd_member
- asynccreate_channel
- asynccreate_emoji
- asynccreate_event
- asynccreate_role
- asynccreate_sticker
- asynccreate_template
- asyncdelete
- asyncedit_welcome_screen
- asyncedit_widget
- asyncfetch_active_threads
- asyncfetch_application_command
- asyncfetch_application_commands
- asyncfetch_audit_logs
- asyncfetch_ban
- asyncfetch_bans
- asyncfetch_channels
- asyncfetch_emoji
- asyncfetch_emojis
- asyncfetch_event
- asyncfetch_events
- asyncfetch_guild_widget_image
- asyncfetch_integrations
- asyncfetch_member
- asyncfetch_members
- asyncfetch_members_by_name
- asyncfetch_prune_count
- asyncfetch_regions
- asyncfetch_roles
- asyncfetch_sticker
- asyncfetch_stickers
- asyncfetch_template
- asyncfetch_templates
- asyncfetch_vanity_invite
- asyncfetch_webhooks
- asyncfetch_welcome_screen
- asyncfetch_widget
- asyncfetch_widget_settings
- defget_channel
- defget_member
- asyncleave
- asyncmove_roles
- asyncprune
- asyncunban
- class acord.models.Guild(*, conn: Any = None, id: acord.models.Snowflake, name: str, icon: str = None, afk_channel_id: acord.models.Snowflake = None, afk_timeout: int = None, application_command_count: int = None, application_command_counts: Dict[str, int] = None, application_id: acord.models.Snowflake = None, banner: str = None, channels: Dict[acord.models.Snowflake, acord.models.channels.base.Channel] = {}, default_message_notifications: acord.bases.enums.guild.GuildMessageNotification, description: str = None, discovery_splash: str = None, embedded_activities: List[Any] = [], emojis: Dict[acord.models.Snowflake, acord.models.emoji.Emoji], explicit_content_filter: acord.bases.enums.guild.ExplicitContentFilterLevel, features: List[str], guild_hashes: Dict[Any, Any] = {}, guild_scheduled_events: Dict[acord.models.Snowflake, acord.models.guild_sched_event.GuildScheduledEvent] = {}, hub_type: bool = None, joined_at: datetime.datetime = None, large: bool = False, lazy: bool = None, max_members: int, max_video_channel_users: int = None, member_count: int = 0, members: Dict[acord.models.Snowflake, acord.models.member.Member] = {}, mfa_level: acord.bases.enums.guild.MFALevel, nsfw: bool, nsfw_level: acord.bases.enums.guild.NSFWLevel, owner_id: acord.models.Snowflake, preferred_locale: str, premium_progress_bar_enabled: bool = None, premium_subscription_count: int, premium_tier: acord.bases.enums.guild.PremiumTierLevel, presences: List[Dict[str, Any]] = None, public_updates_channel_id: acord.models.Snowflake = None, roles: Dict[acord.models.Snowflake, acord.models.roles.Role], rules_channel_id: acord.models.Snowflake = None, splash: str = None, stage_instances: List[Any] = [], stickers: Dict[acord.models.Snowflake, acord.models.sticker.Sticker] = {}, system_channel_flags: int = None, system_channel_id: acord.models.Snowflake = None, threads: Dict[acord.models.Snowflake, acord.models.channels.thread.Thread] = {}, unavailable: bool = None, vanity_url_code: str = None, verification_level: acord.bases.enums.guild.VerificationLevel, voice_states: List[Any] = [], created_at: datetime.datetime = None)[source]¶
Respresentation of a discord guild
Note
When working with the guild object,
Guild.largemay be useful to prevent grabbing members which exist but are not cached. This is only applicable when this value isTrue.- add_member(user_id: Union[acord.models.user.User, acord.models.Snowflake], access_token: str, *, nick: str = None, roles: List[Union[acord.models.roles.Role, acord.models.Snowflake]] = None, mute: bool = None, deaf: bool = None, reason: str = None) Optional[acord.models.member.Member][source]¶
This function is a coroutine.
For bots with an
access_tokenfor aUser, you may use this method for adding the user to this guild.Note
Requires
guilds.joinscope inorder to add the user- Parameters
access_token (
str) – Access token to be usednick (
str) – Nickname for userroles (List[Union[
Role,Snowflake]]) – List of roles to give user on joinmute (
bool) – Whether the user is muted in voice channelsdead (
bool) – Whether the user is deafened in voice channelsreason (
str) – Reason for adding member to guild
- async classmethod create(client, **data) Optional[acord.models.guild.Guild][source]¶
This function is a coroutine.
Creates a new guild, were the client is the owner.
Warning
Can only be used for bots in less then 10 guilds
- Parameters
client (
Client) – client being used to create guildname (
str) – name of the guild (2-100 characters)icon (
File) – image for the guild iconverification_level (
VerificationLevel) – verification level for guilddefault_message_notifications (
GuildMessageNotification) – default message notif for guildexplicit_content_filter (
ExplicitContentFilterLevel) – explicit content filter for guildroles (List[
Role]) – list of roles for guildchannels (List[
PartialChannel]) – list of partial channels for guildafk_channel_id (
Snowflake) – id for afk channelafk_timeout (
int) – afk timeout in secondssystem_channel_id (
Snowflake) – the id of the channel where guild notices such as welcome messages and boost events are postedsystem_channel_flags (
SystemChannelFlags) – guild system channel flags
- async create_channel(*, reason: Optional[str] = None, **data) acord.models.channels.base.Channel[source]¶
This function is a coroutine.
Creates a new channel in the guild
- Parameters
name (
str) – Name of channeltype (
ChannelTypes) – Type of channel to createtopic (
str) – Channel topicbitrate (
int) – Bitrate for channel, VOICE ONLYuser_limit (
int) – User limit for channel, VOICE ONLYrate_limit_per_user (
int) – Slowmode for channelposition (
integer) – Sorting position of channelpermission_overwrite (List[
PermissionsOverwrite]) – channel permission overwritesparent_id (
Snowflake) – id of the parent category for channelnsfw (
bool) – Whether to mark channel as NSFWreason (
str) – Reason for creating channel
- async create_emoji(*, reason: Optional[str] = None, **data) acord.models.emoji.Emoji[source]¶
This function is a coroutine.
Creates new guild emoji
- async create_event(*, reason: Optional[str] = None, **data) acord.models.guild_sched_event.GuildScheduledEvent[source]¶
This function is a coroutine.
Creates a new guild scheduled event
- Parameters
reason (
str) – reason for creating evententity_type (
ScheduledEventEntityType) – the entity type of the scheduled eventname (
str) – name of the eventchannel_id (
Snowflake) – the channel id of the scheduled event.entity_metadata (
ScheduledEventMetaData) – the entity metadata of the scheduled eventprivacy_level (
ScheduledEventPrivacyLevel) – the privacy level of the scheduled eventscheduled_start_time (
datetime.datetime) – the start time of the scheduled eventscheduled_end_time (
datetime.datetime) – the end time of the scheduled eventdescription (
str) – the description of the scheduled event
- async classmethod create_from_template(client, code: str, **data) acord.models.guild.Guild[source]¶
This function is a coroutine.
Creates a guild from a template
Warning
Can only be used for bots in less then 10 guilds
- async create_role(*, reason: Optional[str] = None, **data) acord.models.roles.Role[source]¶
This function is a coroutine.
Creates a new role in the guild
- Parameters
name (
str) – Name of new role, if not provided sets tonew rolepermissions (
Permissions) – Role permissionscolor (
EmbedColor) – Colour of role, for reference checkoutEmbed.colorhoist (
bool) – Whether to display role seperatelyicon (
File) – the role’s icon imageunicode_emoji (
str) – the role’s icon as a unicode emojimentionable (
bool) – whether the role can be mentionedreason (
str) – reason for creating role
- async create_sticker(*, reason: Optional[str] = None, **data) acord.models.sticker.Sticker[source]¶
This function is a coroutine.
Creates a new guild sticker
- async create_template(**data) acord.models.guild_template.GuildTemplate[source]¶
This function is a coroutine.
Create new guild template
- async delete() None[source]¶
This function is a coroutine.
Deletes this guild permanently, client must be owner
- edit_welcome_screen(*, enabled: bool, welcome_channels: List[acord.models.guild.WelcomeChannel], description: str, reason: str) acord.models.guild.WelcomeScreen[source]¶
This function is a coroutine.
Modifies guild welcome screen
- Parameters
enabled (
bool) – whether screen is enabled or notwelcome_channels (List[
WelcomeChannel]) – channels linked in the welcome screen and their display optionsdescription (
str) – the server description to show in the welcome screenreason (
str) – Reason for modifying guild welcome screen
- async edit_widget(*, reason: Optional[str] = None, **data) acord.models.guild.GuildWidget[source]¶
This function is a coroutine.
Edits guild widget
- async fetch_active_threads(*, include_private: bool = True) Iterator[acord.models.channels.thread.Thread][source]¶
This function is a coroutine.
Fetches all active threads in guild
- Parameters
include_private (
bool) – Whether to include private threads when yielding
- async fetch_application_command(command_id: acord.models.Snowflake) Any[source]¶
This function is a coroutine.
Fetches an application command that the client has created
- Parameters
command_id (
Snowflake) – ID of command
- async fetch_application_commands() Iterator[Any][source]¶
This function is a coroutine.
Fetches all application commands that the client has created
- async fetch_audit_logs(*, user_id: Optional[acord.models.Snowflake] = None, action_type: Optional[acord.bases.enums.audit_logs.AuditLogEvent] = None, before: Optional[acord.models.Snowflake] = None, limit: int = 50) acord.models.audit_logs.AuditLog[source]¶
This function is a coroutine.
Fetches guilds audit log
- async fetch_ban(user_id: Union[acord.models.user.User, acord.models.Snowflake]) Optional[acord.models.guild.Ban][source]¶
This function is a coroutine.
Fetches ban for this user, if exists.
- async fetch_bans() Iterator[acord.models.guild.Ban][source]¶
This function is a coroutine.
Returns all the users banned in the guild
- async fetch_channels() Iterator[acord.models.channels.base.Channel][source]¶
This function is a coroutine.
Fetches all channels in the guild, doesn’t include threads!
- async fetch_emoji(emoji_id: acord.models.Snowflake) acord.models.emoji.Emoji[source]¶
This function is a coroutine.
Fetches a single emoji, using provided ID
- Parameters
emoji_id (
Snowflake) – id of emoji to fetch
- async fetch_emojis() Iterator[acord.models.emoji.Emoji][source]¶
This function is a coroutine.
Fetches all emojis in guild
- async fetch_event(event_id: acord.models.Snowflake) acord.models.guild_sched_event.GuildScheduledEvent[source]¶
This function is a coroutine.
Fetches a scheduled event from the guild
- Parameters
event_id (
Snowflake) – ID of event to fetch
- async fetch_events() Iterator[acord.models.guild_sched_event.GuildScheduledEvent][source]¶
This function is a coroutine.
Fetches all scheduled events for guild
- async fetch_guild_widget_image(*, style: acord.models.guild.GuildWidgetImageStyle = GuildWidgetImageStyle.shield) _io.BytesIO[source]¶
This function is a coroutine.
Fetches guild widget image, using one of
GuildWidgetImageStyle. Returnsio.BytesIOwith the image in it.- Parameters
style (
GuildWidgetImageStyle) – Style of banner
- async fetch_integrations() Iterator[acord.models.integrations.Integration][source]¶
This function is a coroutine.
Returns an iterator of integrations in the guild
- async fetch_member(*, member: Union[acord.models.member.Member, acord.models.Snowflake]) Optional[acord.models.member.Member][source]¶
This function is a coroutine.
Fetches a member from the guild
- async fetch_members(*, limit: int = 1, after: acord.models.Snowflake = 0) Iterator[acord.models.member.Member][source]¶
This function is a coroutine.
Fetches guild members
- async fetch_members_by_name(query: str, *, limit: int = 1) Iterator[acord.models.member.Member][source]¶
This function is a coroutine.
Fetches members by there username(s) or nickname(s)
- fetch_prune_count(*, days: int = 7, include_roles: List[acord.models.roles.Role] = []) int[source]¶
This function is a coroutine.
Fetches guild prune count and returns the count, without actually pruning members.
- async fetch_regions() Iterator[acord.models.channels.voice.VoiceRegion][source]¶
This function is a coroutine.
Returns an iterator of voice region objects for the guild.
- async fetch_roles() Iterator[acord.models.roles.Role][source]¶
This function is a coroutine.
Fetches roles in guild
- async fetch_sticker(sticker_id: acord.models.Snowflake) acord.models.sticker.Sticker[source]¶
This function is a coroutine.
Fetches a single sticker, using provided ID
- Parameters
sticker_id (
Snowflake) – id of sticker to fetch
- async fetch_stickers() Iterator[acord.models.sticker.Sticker][source]¶
This function is a coroutine.
Fetches all stickers in guild
- async fetch_template(code: str, /) acord.models.guild_template.GuildTemplate[source]¶
This function is a coroutine.
Fetches a guild template
- Parameters
code (
str) – template code to fetch
- async fetch_templates() Iterator[acord.models.guild_template.GuildTemplate][source]¶
This function is a coroutine.
Fetches all templates in the guild
- async fetch_vanity_invite() acord.models.invite.Invite[source]¶
This function is a coroutine.
Fetches guild vanity invite
- async fetch_webhooks() Iterator[acord.webhooks.webhook.Webhook][source]¶
This function is a coroutine.
Fetches all webhooks in guild
- async fetch_welcome_screen() acord.models.guild.WelcomeScreen[source]¶
This function is a coroutine.
Fetches guild welcome screen
- async fetch_widget() Dict[str, Any][source]¶
This function is a coroutine.
Fetches guild widget, returns the raw data as of now
- async fetch_widget_settings() acord.models.guild.GuildWidget[source]¶
This function is a coroutine.
Returns the guild widget settings
- get_channel(channel_id: acord.models.Snowflake, /) Optional[acord.models.channels.base.Channel][source]¶
This is a function.
Gets a channel from cache, which only belongs to this guild
- Parameters
channel_id (
Snowflake) – ID of channel to get
- get_member(member_id: acord.models.Snowflake, /) Optional[acord.models.member.Member][source]¶
This is a function.
Gets a member from internal mapping
- Parameters
member_id (
Snowflake) – ID of member to get
- move_roles(*positons: acord.payloads.RoleMovePayload, reason: str = None) Iterator[acord.models.roles.Role][source]¶
This function is a coroutine.
Modify positon of roles in guild
- prune(*, days: int = 7, compute_prune_count: bool = True, include_roles: List[acord.models.roles.Role] = [], reason: str = None) Optional[int][source]¶
This function is a coroutine.
Prunes members, returns amount of pruned IF
compute_prune_countis True.
- async unban(user_id: Union[acord.models.user.User, acord.models.Snowflake], *, reason: Optional[str] = None) None[source]¶
This function is a coroutine.
Removes ban from user
- afk_channel_id: Optional[acord.models.Snowflake]¶
AFK channel id
- application_id: Optional[acord.models.Snowflake]¶
application id of the guild creator if it is bot-created
- channels: Dict[acord.models.Snowflake, acord.models.channels.base.Channel]¶
All channels in the guild
- created_at: Optional[datetime.datetime]¶
when the guild was created
- default_message_notifications: acord.bases.enums.guild.GuildMessageNotification¶
Default message notification
- emojis: Dict[acord.models.Snowflake, acord.models.emoji.Emoji]¶
List of emojis in guild
- explicit_content_filter: acord.bases.enums.guild.ExplicitContentFilterLevel¶
explicit content filter level
ExplicitContentFilterLevel
- guild_scheduled_events: Dict[acord.models.Snowflake, acord.models.guild_sched_event.GuildScheduledEvent]¶
List of scheduled guild events
- id: acord.models.Snowflake¶
Guild ID
- joined_at: datetime.datetime¶
When the user joined this guild, May be
Noneif your fetching from API.
- members: Dict[acord.models.Snowflake, acord.models.member.Member]¶
Mapping of all members in guild
- mfa_level: acord.bases.enums.guild.MFALevel¶
required MFA level for the guild
- nsfw_level: acord.bases.enums.guild.NSFWLevel¶
Guild NSFW level
- owner_id: acord.models.Snowflake¶
ID of the guild owner
Whether Boosts progress bar is enabled
Number of guild boosts
premium tier (Server Boost level)
- presences: Optional[List[Dict[str, Any]]]¶
presences of the members in the guild, will only include non-offline members if the size is greater than large threshold
- public_updates_channel_id: Optional[acord.models.Snowflake]¶
the id of the channel where admins and moderators of Community guilds receive notices from Discord
- roles: Dict[acord.models.Snowflake, acord.models.roles.Role]¶
List of roles in the guild
- rules_channel_id: Optional[acord.models.Snowflake]¶
the id of the channel where Community guilds can display rules and/or guidelines
- stage_instances: Optional[List[Any]]¶
Stage instances in the guild
- stickers: Optional[Dict[acord.models.Snowflake, acord.models.sticker.Sticker]]¶
List of guild stickers
- system_channel_id: Optional[acord.models.Snowflake]¶
the id of the channel where guild notices such as welcome messages and boost events are posted
- threads: Optional[Dict[acord.models.Snowflake, acord.models.channels.thread.Thread]]¶
Mapping of threads in the guild
Whether guild is operational or lost due to outage
- verification_level: acord.bases.enums.guild.VerificationLevel¶
verification level required for the guild
- voice_states: Optional[List[Any]]¶
array of partial voice state objects
GuildScheduledEvent¶
- asyncdelete
- asyncedit
- asyncfetch_users
- class acord.models.GuildScheduledEvent(*, conn: Any = None, id: acord.models.Snowflake, guild_id: acord.models.Snowflake, channel_id: acord.models.Snowflake = None, creator_id: acord.models.Snowflake = None, name: str, description: str = None, scheduled_start_time: datetime.datetime, scheduled_end_time: datetime.datetime = None, privacy_level: acord.bases.enums.events.ScheduledEventPrivacyLevel, status: acord.bases.enums.events.ScheduledEventStatus, entity_type: acord.bases.enums.events.ScheduledEventEntityType, entity_id: acord.models.Snowflake = None, entity_metadata: acord.models.guild_sched_event.ScheduledEventMetaData, creator: acord.models.user.User = None, user_count: int = None)[source]¶
-
- async edit(*, reason: Optional[str] = None, **data) acord.models.guild_sched_event.GuildScheduledEvent[source]¶
This function is a coroutine.
Edits a scheduled event, to start or end an event use this method.
- Parameters
reason (
str) – reason for editing evententity_type (
ScheduledEventEntityType) – the entity type of the scheduled eventname (
str) – name of the eventchannel_id (
Snowflake) – the channel id of the scheduled event.entity_metadata (
ScheduledEventMetaData) – the entity metadata of the scheduled eventprivacy_level (
ScheduledEventPrivacyLevel) – the privacy level of the scheduled eventscheduled_start_time (
datetime.datetime) – the start time of the scheduled eventscheduled_end_time (
datetime.datetime) – the end time of the scheduled eventdescription (
str) – the description of the scheduled eventstatus (
ScheduledEventStatus) – the status of the scheduled event
- fetch_users(*, limit: int = 100, with_member: bool = False, before: acord.models.Snowflake = None, after: acord.models.Snowflake = None) Iterator[acord.models.guild_sched_event.ScheduledEventUser][source]¶
This function is a coroutine.
Fetches members who have joined this event
- Parameters
limit (
int) – How many members to fetchwith_member (
bool) –ScheduledEventUser.memberwill contain a member object, of who subcribed to the eventbefore (
Snowflake) – consider only users before given user idafter (
Snowflake) – consider only users after given user id
- channel_id: Optional[acord.models.Snowflake]¶
the channel id the event will be hosted in
- creator: Optional[acord.models.user.User]¶
the user that created the scheduled event
- creator_id: Optional[acord.models.Snowflake]¶
the id of the user who created the event
- entity_id: Optional[acord.models.Snowflake]¶
the id of an entity associated with a guild scheduled event
- entity_metadata: acord.models.guild_sched_event.ScheduledEventMetaData¶
additional metadata for the guild scheduled event
- entity_type: acord.bases.enums.events.ScheduledEventEntityType¶
entity type of scheduled event
- guild_id: acord.models.Snowflake¶
the guild id the event belongs to
- id: acord.models.Snowflake¶
the id of the scheduled event
- privacy_level: acord.bases.enums.events.ScheduledEventPrivacyLevel¶
the privacy level of the scheduled event
- scheduled_end_time: Optional[datetime.datetime]¶
the time the scheduled event will end
- scheduled_start_time: datetime.datetime¶
the time the scheduled event will start
- status: acord.bases.enums.events.ScheduledEventStatus¶
the status of the scheduled event
GuildTemplate¶
- class acord.models.GuildTemplate(*, conn: Any = None, code: str, name: str, description: str = None, usage_count: int, creator_id: acord.models.Snowflake, creator: acord.models.user.User, created_at: str, updated_at: str, source_guild_id: acord.models.Snowflake, serialized_source_guild: Any = None, is_dirty: bool = None)[source]¶
- async delete() acord.models.guild_template.GuildTemplate[source]¶
This function is a coroutine.
Deletes template, returns template on success.
- async edit(**data) acord.models.guild_template.GuildTemplate[source]¶
This function is a coroutine.
Edits current template
- async sync() acord.models.guild_template.GuildTemplate[source]¶
This function is a coroutine.
Syncs current guild template.
- creator: acord.models.user.User¶
the user who created the template
- creator_id: acord.models.Snowflake¶
the ID of the user who created the template
- serialized_source_guild: acord.models.guild.Guild¶
the guild snapshot this template contains
- source_guild_id: acord.models.Snowflake¶
the ID of the guild this template is based on
GuildWidget¶
- class acord.models.GuildWidget(*, enabled: bool, channel_id: acord.models.Snowflake)[source]¶
GuildWidgetImageStyle¶
Integration¶
- asyncdelete
- class acord.models.Integration(*, conn: Any = None, id: acord.models.Snowflake, name: str, type: str, account: acord.models.integrations.IntegrationAccount, guild_id: acord.models.Snowflake, enabled: bool, syncing: bool = None, role_id: acord.models.Snowflake = None, enable_emoticons: bool = None, expire_behavior: acord.models.integrations.IntegrationExpBehaviour = None, expire_grace_period: int = None, user: acord.models.user.User = None, synced_at: datetime.datetime = None, subscriber_count: int = None, revoked: bool = None, application: acord.models.integrations.IntegrationApplication = None)[source]¶
IntegrationAccount¶
- class acord.models.IntegrationAccount(*, id: acord.models.Snowflake, name: str)[source]¶
IntegrationApplication¶
- class acord.models.IntegrationApplication(*, id: acord.models.Snowflake, name: str, icon: str, description: str, summary: str, bot: acord.models.user.User = None)[source]¶
IntegrationExpBehaviour¶
Interaction¶
- asyncdelete_original_response
- asyncdelete_response
- asyncedit_message
- asyncedit_original_response
- asyncfetch_message
- asyncfetch_original_response
- asyncrespond
- asyncrespond_to_autocomplete
- asyncrespond_with_modal
- asyncsend_followup
- class acord.models.Interaction(*, conn: Any = None, hook: Any = None, id: acord.models.Snowflake, application_id: acord.models.Snowflake, type: acord.bases.enums.interactions.InteractionType, token: str, version: int, data: acord.models.interaction.InteractionData = None, guild_id: acord.models.Snowflake = None, channel_id: acord.models.Snowflake = None, member: acord.models.member.Member = None, user: acord.models.user.User = None, message: acord.models.message.Message = None)[source]¶
- async delete_original_response() None[source]¶
This function is a coroutine.
Deletes original message that was created when interaction responded
- async delete_response(message_id: acord.models.Snowflake) None[source]¶
This function is a coroutine.
Deletes message that was created by this interaction
- Parameters
message_id (
Snowflake) – ID of message to delete
- async edit_message(message_id: acord.models.Snowflake, **kwds) None[source]¶
This function is a coroutine.
Edits a follow up message sent by interaction
Note
Refer to
Webhook.edit_message()for further guidance
- async edit_original_response(**kwds) None[source]¶
This function is a coroutine.
Edits original message created by interaction
Note
Refer to
Webhook.edit_message()for further guidance
- async fetch_message(message_id: acord.models.Snowflake)[source]¶
This function is a coroutine.
Fetches a followup message created by interaction
- Parameters
message_id (
Snowflake) – ID of message to fetch
- async fetch_original_response() Any[source]¶
This function is a coroutine.
Fetches original message that was created when interaction responded.
- async respond(**kwds) None[source]¶
This function is a coroutine.
Responds to an interaction.
Note
Refer to
Webhook.respond_with_message()for further guidance.
- async respond_to_autocomplete(choices: List[acord.ext.application_commands.option.AutoCompleteChoice]) None[source]¶
This function is a coroutine.
Responds to an interaction with a list of choices
- Parameters
choices (List[
AutoCompleteChoice]) – List of choices to return the user, can be a list of dicts with the mapping name: value
- async respond_with_modal(modal: acord.bases.components.Modal) None[source]¶
This function is a coroutine.
Responds to an interaction using a modal.
- Parameters
modal (
Modal) – Modal to respond with
- async send_followup(**kwds)[source]¶
This function is a coroutine.
Sends a follow up message an interaction
Note
Refer to
Webhook.send_followup_message()for further guidance.
- application_id: acord.models.Snowflake¶
id of the application this interaction is for
- channel_id: Optional[acord.models.Snowflake]¶
the channel it was sent from
- data: Optional[acord.models.interaction.InteractionData]¶
the command data payload
- guild_id: Optional[acord.models.Snowflake]¶
the guild it was sent from
- id: acord.models.Snowflake¶
ID of interaction
- member: Optional[acord.models.member.Member]¶
guild member data for the invoking user, including permissions
- message: acord.models.message.Message¶
for components, the message they were attached to
- type: acord.bases.enums.interactions.InteractionType¶
the type of interaction
- user: Optional[acord.models.user.User]¶
user payloadject for the invoking user, if invoked in a DM
InteractionData¶
- class acord.models.InteractionData(*, id: acord.models.Snowflake = None, name: str = None, type: acord.ext.application_commands.types.ApplicationCommandType = None, resolved: Any = None, options: List[acord.models.interaction.InteractionSlashOption] = [], custom_id: str = None, component_type: acord.bases.enums.components.ComponentTypes = None, values: List[str] = None, target_id: acord.models.Snowflake = None, components: Any = None)[source]¶
InteractionSlashOption¶
Invite¶
- clsInvite.from_code
- asyncdelete
- class acord.models.Invite(*, conn: Any = None, code: str, guild_id: acord.models.Snowflake = None, channel_id: acord.models.Snowflake, inviter: acord.models.user.User = None, target_type: int = None, target_user: acord.models.user.User = None, target_application: Any = None, approximate_presence_count: int = None, approximate_member_count: int = None, max_age: Optional[Union[datetime.datetime, int]] = None, max_uses: int = None, stage_instance: acord.models.invite.StageInstanceInvite = None)[source]¶
- async delete(*, reason: str) None[source]¶
This function is a coroutine.
Deletes this invite
- Parameters
reason (
str) – Reason for deleting invite
- async classmethod from_code(client, code: str, **params) acord.models.invite.Invite[source]¶
This function is a coroutine.
Creates a new invite from its code, fetches from API.
Warning
This will return an object without a conn parameters, so methods like
Invite.delete()will not function.- Parameters
client (
Client) – client being used to fetch invitecode (
str) – code of invite to fetchwith_counts (
bool) – whether the invite should contain approximate member countswith_expiration (
bool) – whether the invite should contain the expiration dateguild_scheduled_event_id (
bool) – the guild scheduled event to include with the invite
- channel_id: acord.models.Snowflake¶
the channel this invite is for
- expires_at: Optional[Union[datetime.datetime, int]]¶
the expiration date of this invite.
Note
If value is an
int, this is duration in seconds.
- guild_id: Optional[acord.models.Snowflake]¶
the guild this invite is for
- inviter: Optional[acord.models.user.User]¶
the user who created the invite
- stage_instance: Optional[acord.models.invite.StageInstanceInvite]¶
stage instance data if there is a public Stage instance in the Stage channel this invite is for
- target_application: Optional[Any]¶
the embedded application to open for this voice channel embedded application invite
- target_user: Optional[acord.models.user.User]¶
the user whose stream to display for this voice channel stream invite
Member¶
- asyncadd_role
- asyncadd_roles
- asyncban
- asyncedit
- asynckick
- asyncremove_role
- asyncremove_roles
- class acord.models.Member(*, conn: Any = None, guild_id: acord.models.Snowflake, user: acord.models.user.User = None, nick: str = None, avatar: str = None, roles: List[acord.models.Snowflake], joined_at: datetime.datetime, premium_since: datetime.datetime = None, deaf: bool, mute: bool, pending: bool = None, permissions: str = None, voice_state: acord.models.member.MemberVoiceState = None, presence: acord.models.member.MemberPresence = None)[source]¶
Represents a guild member.
- user¶
The User object of the member. Not included in MESSAGE_CREATE and MESSAGE_UPDATE events
- Type
- joined_at¶
The time the user joined the guild
- Type
When the user started boosting the guild
- Type
- pending¶
Whether if the member is pending verification. Not included in NONE-GUILD-EVENTS events
- Type
- voice_state¶
Voice state of a member
- Type
- presence¶
Presence of member
- Type
- async add_role(role: acord.models.roles.Role, *, reason: Optional[str] = None) None[source]¶
This function is a coroutine.
Adds a single role to user, for more roles consider using:
- async add_roles(*roles, reason: Optional[str] = None) acord.models.member.Member[source]¶
This function is a coroutine.
Adds many roles to the member in one go, utility method for
Member.edit().
- async ban(*, reason: Optional[str] = None, delete_message_days: int = 0) None[source]¶
This function is a coroutine.
Bans this member from the guild
- async edit(*, reason: Optional[str] = None, **data) acord.models.member.Member[source]¶
This function is a coroutine.
Modifies current member
- Parameters
nick (
str) – New nickname for userroles (
str) – New roles for members, roles will be updated exactly as provided. If you wish to keep existing roles, useMember.add_role().mute (
bool) – whether the user is muted in voice channels. Raises BadRequest if user is not in a VC.deaf (
bool) – whether the user is deafened in voice channels. Raises BadRequest if user is not in a VC.channel_id (
Snowflake) – id of channel to move user to (if they are connected to voice).communication_disabled_until (
datetime.datetime) – User communication timeout. If set toNone, removes timeout.
- async kick(*, reason: Optional[str] = None) None[source]¶
This function is a coroutine.
Kicks this member from the guild
- Parameters
reason (
str) – Reason for kicking member
- async remove_role(role: acord.models.roles.Role, *, reason: Optional[str] = None) None[source]¶
This function is a coroutine.
Remove a role from member
- async remove_roles(*roles, reason: Optional[str] = None) acord.models.member.Member[source]¶
This function is a coroutine.
Removes many roles from the member in one go, utility method for
Member.edit().
MemberPresence¶
- class acord.models.MemberPresence(*, user_id: acord.models.Snowflake, status: acord.bases.presence.StatusType, guild_id: acord.models.Snowflake, client_status: Any = None, activities: List[acord.bases.presence.Activity])[source]¶
MemberVoiceState¶
- class acord.models.MemberVoiceState(*, guild_id: acord.models.Snowflake = None, channel_id: acord.models.Snowflake = None, session_id: str, deaf: bool, mute: bool, self_deaf: bool, self_mute: bool, self_stream: bool = None, self_video: bool, suppress: bool, request_to_speak_timestamp: datetime.datetime = None)[source]¶
Message¶
- asyncadd_reaction
- asyncclear_reactions
- asynccrosspost
- asyncdelete
- asyncedit
- asyncget_reactions
- asyncpin
- asyncrefetch
- asyncremove_reaction
- asyncreply
- asyncunpin
- class acord.models.Message(*, conn: Any = None, activity: Any = None, application: acord.models.application.Application = None, attachments: List[acord.models.attachment.Attachment], author: acord.models.user.User, channel_id: int, components: List[acord.bases.components.ActionRow], content: str, edited_timestamp: Optional[Union[bool, datetime.datetime]] = None, embeds: List[acord.bases.embeds.Embed], flags: acord.bases.flags.message.MessageFlags, id: acord.models.Snowflake, interaction: Any = None, guild_id: acord.models.Snowflake = None, member: acord.models.member.Member = None, mentions: List[Union[acord.models.user.User, Any]], mention_everyone: bool, mention_roles: List[Any], mention_channels: List[Any] = None, nonce: int = None, pinned: bool, reactions: Dict[acord.models.partials.PartialEmoji, List[acord.models.message.MessageReaction]] = [], referenced_message: Optional[Union[Message, MessageReference]], thread: Any = None, timestamp: datetime.datetime, tts: bool, type: int, sticker_items: List[acord.models.sticker.Sticker] = None, stickers: List[Any] = None, webhook_id: int = None)[source]¶
- async add_reaction(emoji: Union[str, acord.models.emoji.Emoji]) None[source]¶
Add an emoji to the message. Raises 403 if you lack permissions or 404 if message not found.
- async clear_reactions(*, emoji: Optional[Union[str, acord.models.emoji.Emoji]] = None) None[source]¶
Clear all reactions/x reactions on a message. Raises 403 if you lack permissions or 404 if message not found.
- async crosspost() acord.models.message.Message[source]¶
Crossposts a message in a news channel
- async delete(*, reason: Optional[str] = None) None[source]¶
Deletes the message from the channel. Raises 403 is you don’t have sufficient permissions or 404 is the message no longer exists.
- Parameters
reason (
str) – Reason for deleting message, shows up in AUDIT-LOGS
- async edit(**data) acord.models.message.Message[source]¶
This function is a coroutine.
Modifies current message
- Parameters
content (
str) – new content for messageembeds (Union[List[
Embed],Embed]) –List of embeds to update message with.
Warning
Embeds are updated EXACTLY as they are provided.
So doing
Message.edit(embeds=Embed)will remove previous embeds. For extending embeds you can use something like:from acord import Embed embeds = Message.embeds newEmbed = Embed(**kwargs) embeds.append(newEmbed) await Message.edit(embeds=embeds)
flags (
MessageFlags) –edit message flags
Warning
only
MessageFlags.SUPPRESS_EMBEDScan currently be set/unsetallowed_mentions (
AllowedMentions) – edit allowed mentions for messagefiles (Union[List[
File],File]) – list of files to update message with, works the same way as the embeds parameter
- get_reactions(emoji: Union[str, acord.models.emoji.Emoji], *, after: Union[acord.models.user.User, acord.models.Snowflake], limit: int = 25) List[acord.models.user.User][source]¶
This function is a coroutine.
Fetches users from a reaction
- async refetch() Optional[acord.models.message.Message][source]¶
This function is a coroutine.
Attempts to fetch the same message from the API again
- async remove_reaction(emoji: Union[str, acord.models.emoji.Emoji], user_id: Union[str, int] = '@me') None[source]¶
Removes a reaction on a message set by a specified user. Raises 403 if you lack permissions or 404 if message not found.
- async reply(**data) acord.models.message.Message[source]¶
Shortcut for Message.Channel.send(…, reference=self)
- activity: Any¶
sent with Rich Presence-related chat embeds
- application: Optional[acord.models.application.Application]¶
sent with Rich Presence-related chat embeds
- attachments: List[acord.models.attachment.Attachment]¶
List of Attachment objects
- author: acord.models.user.User¶
User object of who sent the message
- property channel¶
Returns the channel message was sent in
- components: List[acord.bases.components.ActionRow]¶
List of all components in the message
- embeds: List[acord.bases.embeds.Embed]¶
List of embeds
- flags: acord.bases.flags.message.MessageFlags¶
Message flags
- property guild¶
Returns the guild message was sent in
- guild_id: Optional[acord.models.Snowflake]¶
Guild ID of were message was sent
- id: acord.models.Snowflake¶
Message ID
- interaction: Optional[acord.models.interaction.Interaction]¶
Message Interaction
- member: Optional[acord.models.member.Member]¶
Member object of who sent the message
- mention_channels: Optional[List[acord.models.channels.base.Channel]]¶
List of mentioned channels
- mention_roles: List[Any]¶
If message mentioned any roles
- mentions: List[Union[acord.models.user.User, Any]]¶
List of mentioned users
- reactions: Dict[acord.models.partials.PartialEmoji, List[acord.models.message.MessageReaction]]¶
List of reactions
- referenced_message: Optional[Union[acord.models.message.Message, acord.models.message.MessageReference]]¶
Replied message
- sticker_items: Optional[List[acord.models.sticker.Sticker]]¶
List of stickers
- thread: Optional[acord.models.channels.thread.Thread]¶
Thread were message was sent
- timestamp: datetime.datetime¶
List of reactions
MessageReaction¶
- class acord.models.MessageReaction(*, user_id: acord.models.Snowflake = None, channel_id: acord.models.Snowflake, message_id: acord.models.Snowflake, guild_id: acord.models.Snowflake = None, emoji: acord.models.partials.PartialEmoji)[source]¶
MessageReference¶
- class acord.models.MessageReference(*, message_id: acord.models.Snowflake, channel_id: acord.models.Snowflake = None, guild_id: acord.models.Snowflake = None, fail_if_not_exists: bool = True)[source]¶
PartialChannel¶
PartialEmoji¶
- class acord.models.PartialEmoji(*, id: acord.models.Snowflake, name: str, animated: bool)[source]¶
PartialIntegration¶
- asyncdelete
- class acord.models.PartialIntegration(*, conn: Any = None, id: acord.models.Snowflake, name: str, type: str, account: acord.models.integrations.IntegrationAccount, guild_id: acord.models.Snowflake)[source]¶
Role¶
- class acord.models.Role(*, conn: Any = None, id: int, name: str, color: acord.bases.embeds.EmbedColor, hoist: bool, icon: str = None, unicode_emoji: str = None, position: int, permissions: acord.bases.flags.permissions.Permissions, managed: bool, mentionable: bool, tags: acord.models.roles.RoleTags = None, guild_id: int)[source]¶
- async delete(*, reason: Optional[str] = None)[source]¶
This function is a coroutine.
Deletes role from guild
- Parameters
reason (
str) – Reason for deleting role
- async edit(*, reason: Optional[str] = None, **data) acord.models.roles.Role[source]¶
This function is a coroutine.
Edits guild role
- Parameters
name (
str) – name for rolepermissions (
Permissions) – enabled/disabled permissionscolor (
EmbedColor) – Colour of the rolehoist (
bool) – whether the role should be displayed separately in the sidebaricon (
File) – the role’s icon imageunicode_emoji (
str) – role’s unicode emojimentionable (
bool) – whether the role should be mentionablereason (
str) – Reason for deleting role
- color: acord.bases.embeds.EmbedColor¶
Colour of role
- permissions: acord.bases.flags.permissions.Permissions¶
Role permissions
- tags: Optional[acord.models.roles.RoleTags]¶
Role tags
ScheduledEventMetaData¶
ScheduledEventUser¶
- class acord.models.ScheduledEventUser(*, guild_scheduled_event_id: acord.models.Snowflake, user: acord.models.user.User, member: acord.models.member.Member = None)[source]¶
- guild_scheduled_event_id: acord.models.Snowflake¶
the scheduled event id which the user subscribed to
- member: Optional[acord.models.member.Member]¶
guild member for this user for the guild which this event belongs to, if any
- user: acord.models.user.User¶
user which subscribed to an event
Snowflake¶
- final class acord.models.Snowflake[source]¶
A concrete representation of a unique id for a discord model
This object is a
intand only contains a few additional properties.- as_integer_ratio()¶
Return integer ratio.
Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator.
>>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1)
- bit_length()¶
Number of bits necessary to represent self in binary.
>>> bin(37) '0b100101' >>> (37).bit_length() 6
- conjugate()¶
Returns self, the complex conjugate of any int.
- from_bytes(byteorder, *, signed=False)¶
Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value.
- signed
Indicates whether two’s complement is used to represent the integer.
- to_bytes(length, byteorder, *, signed=False)¶
Return an array of bytes representing an integer.
- length
Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value.
- signed
Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
- property created_at: datetime.datetime¶
When object was created
- denominator¶
the denominator of a rational number in lowest terms
- imag¶
the imaginary part of a complex number
- numerator¶
the numerator of a rational number in lowest terms
- real¶
the real part of a complex number
StageInstance¶
- class acord.models.StageInstance(*, conn: Any = None, id: int, type: acord.bases.flags.channels.ChannelTypes = ChannelTypes.GUILD_STAGE_VOICE, guild_id: acord.models.Snowflake, channel_id: acord.models.Snowflake, topic: str, privacy_level: acord.bases.enums.stage.StagePrivacyLevel, discoverable_disabled: bool)[source]¶
- async delete(*, reason: Optional[str] = None) None[source]¶
This function is a coroutine.
Deletes this stage instance
- Parameters
reason (
str) – Reason for deleting instance
- async edit(*, reason: Optional[str] = None, **data) acord.models.channels.stage.StageInstance[source]¶
This function is a coroutine.
Edits this stage instance, returning updated instance
- channel_id: acord.models.Snowflake¶
The id of the associated Stage channel
- guild_id: acord.models.Snowflake¶
The guild id of the associated Stage channel
- privacy_level: acord.bases.enums.stage.StagePrivacyLevel¶
The privacy level of the Stage instance
Sticker¶
- clsSticker.from_code
- asyncdelete
- asyncedit
- class acord.models.Sticker(*, conn: Any = None, id: acord.models.Snowflake, pack_id: acord.models.Snowflake = None, name: str, description: str = None, tags: str, asset: str = None, type: int, format_type: int, available: bool = None, guild_id: acord.models.Snowflake = None, user: acord.models.user.User = None, sort_value: int = None)[source]¶
- async delete(*, reason: Optional[str] = None) None[source]¶
This function is a coroutine.
Deletes this sticker
- async edit(*, reason: Optional[str] = None, **data) acord.models.sticker.Sticker[source]¶
This function is a coroutine.
Modifies sticker
- async classmethod from_code(client, sticker_id: acord.models.Snowflake) acord.models.sticker.Sticker[source]¶
This function is a coroutine.
Fetches sticker from API, by using existing client and id
- Parameters
client (
Client) – client to fetch sticker fromsticker_id (
Snowflake) – id of sticker to fetch
- available: Optional[bool]¶
whether this guild sticker can be used, may be false due to loss of Server Boosts
- guild_id: Optional[acord.models.Snowflake]¶
id of the guild that owns this sticker
- id: acord.models.Snowflake¶
ID of the sticker
- pack_id: Optional[acord.models.Snowflake]¶
for standard stickers, id of the pack the sticker is from
- user: Optional[acord.models.user.User]¶
the user that uploaded the guild sticker
TextChannel¶
- asyncbulk_delete
- asynccreate_invite
- asynccreate_thread
- asynccreate_webhook
- asyncedit
- asyncfetch_active_threads
- asyncfetch_invites
- asyncfetch_joined_private_archived_threads
- asyncfetch_message
- asyncfetch_messages
- asyncfetch_private_archived_threads
- asyncfetch_public_archived_threads
- asyncfetch_webhooks
- asyncfollow
- defget_message
- asyncpins
- asyncsend
- asynctrigger_typing
- class acord.models.TextChannel(*, conn: Any = None, id: int, type: acord.bases.flags.channels.ChannelTypes, guild_id: int, position: int, permission_overwrites: List[acord.bases.permissions_overwrite.PermissionsOverwrite] = [], name: str, topic: str = None, nsfw: bool = False, last_message_id: int = None, parent_id: int = None, last_pin_timestamp: datetime.datetime = None, permissions: str = None, rate_limit_per_user: int = None, default_auto_archive_duration: int = None, created_at: datetime.datetime = None)[source]¶
- bulk_delete(*messages: Union[acord.models.message.Message, acord.models.Snowflake], reason: str = None) None[source]¶
This function is a coroutine.
Deletes messages in bulk, in a channel.
Warning
When deleting in bulk, you need at least 2 messages and less then 100.
You must also provide your own messages to delete, for a
purgelike method, use messages fromTextChannel.fetch_messages().
- async create_invite(*, reason: Optional[str] = None, **data) List[acord.models.invite.Invite][source]¶
This function is a coroutine.
Creates new invite in channel
- max_age:
int How long the invite can be used for, must be greater or equal to 0 and less then 604800 (7 Days).
Note
0 is for never
- max_uses:
int How many times invite can be used, before expiring. Must be greater or equal to 0 and less then 100.
Note
0 is for infinite
- temporary:
bool Whether this invite only grants temporary membership
- unique:
bool If true, don’t try to reuse a similar invite (useful for creating many unique one time use invites)
- max_age:
- async create_thread(*, message: Optional[Union[acord.models.message.Message, acord.models.Snowflake]] = None, reason: Optional[str] = None, **options) Optional[acord.models.channels.thread.Thread][source]¶
This function is a coroutine.
Creates a thread in this channel
- async create_webhook(*, reason: Optional[str] = None, **data) acord.webhooks.webhook.Webhook[source]¶
This function is a coroutine.
Creates a new webhook for this channel
- async edit(**options) Optional[acord.models.channels.base.Channel][source]¶
This function is a coroutine.
Modifies a guild channel, fires a
channel_updateevent if channel is updated.- Parameters
name (
str) – New name for the channeltype (Literal[0, 5]) – Change the type for the channel, currently on GUILD_TEXT and GUILD_NEWS is supported
position (
int) – Change the position of the channeltopic (
str) – Change the channels topic, if you wish to remove it use theMISSINGclassnsfw (
bool) – Whether to mark channel as NSFWratelimit (
int) – Change ratelimit value for channelpermission_overwrite (List[
PermissionsOverwrite]) – List of permissions to overwrite in the channelcategory (Union[
int, CategoryChannel]) – Move the channel to a different category, useMISSINGfor no categoryarchive_duration (Literal[0, 60, 1440, 4230, 10080]) – Change the default archive duration on a thread, use
MISSINGor 0 for no timeout
- async fetch_active_threads() Iterator[acord.models.channels.thread.Thread][source]¶
This function is a coroutine.
Fetches all active threads in channel
Warning
Depreciated
This method will no longer work when using API Version >= 10, instead implement
Guild.fetch_active_threads()
- async fetch_invites() List[acord.models.invite.Invite][source]¶
This function is a coroutine.
Fetches all invites from channel
- async fetch_joined_private_archived_threads(*, before: Optional[datetime.datetime] = None, limit: Optional[int] = None) Iterator[acord.models.channels.thread.Thread][source]¶
This function is a coroutine.
Fetches all private archived threads, that the client has joined
- fetch_message(message_id: Union[acord.models.message.Message, acord.models.Snowflake]) Optional[acord.models.message.Message]¶
This function is a coroutine.
Fetch a message directly from channel/thread
- fetch_messages(*, around: Optional[Union[acord.models.message.Message, int]] = None, before: Optional[Union[acord.models.message.Message, int]] = None, after: Optional[Union[acord.models.message.Message, int]] = None, limit: Optional[int] = 50) Iterator[acord.models.message.Message][source]¶
This function is a coroutine.
Fetch messages directly from a channel
- async fetch_private_archived_threads(*, before: Optional[datetime.datetime] = None, limit: Optional[int] = None) Iterator[acord.models.channels.thread.Thread][source]¶
This function is a coroutine.
Fetches all private archived thread in channel
- async fetch_public_archived_threads(*, before: Optional[datetime.datetime] = None, limit: Optional[int] = None) Iterator[acord.models.channels.thread.Thread][source]¶
This function is a coroutine.
Fetches all public archived thread in channel
- async fetch_webhooks() Iterator[acord.webhooks.webhook.Webhook][source]¶
This function is a coroutine.
Fetches all webhooks in channel
- follow(*, channel: Union[acord.models.channels.base.Channel, acord.models.Snowflake]) Dict[str, acord.models.Snowflake][source]¶
This function is a coroutine.
Follows a guild news channel
- get_message(message_id: Union[acord.models.message.Message, acord.models.Snowflake]) Optional[acord.models.message.Message]¶
This is a function.
Returns the message stored in the internal cache, may be outdated
- async pins() Iterator[acord.models.message.Message]¶
This function is a coroutine.
Fetches channel/thread pins
- async send(**data) Optional[acord.models.message.Message]¶
This function is a coroutine.
Create a new message in the channel/thread
- Parameters
content (
str) – Message content, must be below2000chars.files (Union[List[:class:`File`], :class:`File`]) – A file or a list of files to be sent. File must not be closed else an error is raised.
message_reference (Union[
MessageReference]) – A message to reply to, client must be able to read messages in the channel/thread.tts (
bool) – Whether this is a TTS messageembeds (Union[List[:class:`Embed`], :class:`File`]) – An embed or a list of embeds to send
components (List[
ActionRow]) –A list of action rows to send, refer to me for a more detailed guide.
- async trigger_typing() None¶
This function is a coroutine.
Creates a typing indicator in this channel/thread.
- created_at: Optional[datetime.datetime]¶
When this channel was created
- property guild¶
Returns the guild were channel was created in
- last_pin_timestamp: Optional[datetime.datetime]¶
Last pinned message in channel, may be None
- permission_overwrites: Optional[List[PermissionsOverwrite]]¶
Channel Permissions
Thread¶
- asyncadd_member
- asyncedit
- asyncfetch_member
- asyncfetch_members
- asyncfetch_message
- defget_message
- asyncjoin
- asyncleave
- asyncpins
- asyncremove_member
- asyncsend
- asynctrigger_typing
- class acord.models.Thread(*, conn: Any = None, id: acord.models.Snowflake, type: acord.bases.flags.channels.ChannelTypes, guild_id: acord.models.Snowflake, parent_id: acord.models.Snowflake, owner_id: acord.models.Snowflake, name: str, last_message_id: acord.models.Snowflake = None, last_pin_timestamp: datetime.datetime = None, rate_limit_per_user: int = None, message_count: int = None, member_count: int = None, thread_metadata: acord.models.channels.thread.ThreadMeta, members: Dict[acord.models.Snowflake, acord.models.channels.thread.ThreadMember] = {})[source]¶
- async add_member(*, member: Union[acord.models.member.Member, acord.models.Snowflake]) None[source]¶
This function is a coroutine.
Adds a member to the thread
- async edit(*, reason: Optional[str] = None, **options) Optional[acord.models.channels.thread.Thread][source]¶
This function is a coroutine.
Edits the current thread
- Parameters
reason (
str) – Reason for editing threadname (
str) – New name for threadarchived (
bool) – Whether the thread should be archived or notauto_archive_duration (
int) – New auto archive duration, is set from parent channel OR during creationrate_limit_per_user (
int) – New slowmode for users in thread
- async fetch_member(*, member: Union[acord.models.member.Member, acord.models.Snowflake], as_guild_member: bool = False) Optional[Union[acord.models.channels.thread.ThreadMember, acord.models.member.Member]][source]¶
This function is a coroutine.
Fetches member from thread
- Parameters
as_guild_member (
bool) – whether to return the fetched member as aThreadMemberobject orMember
- async fetch_members(*, as_guild_member: bool = False) Iterator[Union[acord.models.member.Member, acord.models.channels.thread.ThreadMember]][source]¶
This function is a coroutine.
Fetches all members in the thread
- Parameters
as_guild_member (
bool) – Whether to return the thread members asThreadMemberorMember
- fetch_message(message_id: Union[acord.models.message.Message, acord.models.Snowflake]) Optional[acord.models.message.Message]¶
This function is a coroutine.
Fetch a message directly from channel/thread
- get_message(message_id: Union[acord.models.message.Message, acord.models.Snowflake]) Optional[acord.models.message.Message]¶
This is a function.
Returns the message stored in the internal cache, may be outdated
- async pins() Iterator[acord.models.message.Message]¶
This function is a coroutine.
Fetches channel/thread pins
- async remove_member(*, member: Union[acord.models.member.Member, acord.models.Snowflake]) None[source]¶
This function is a coroutine.
Removes a member from the thread
- async send(**data) Optional[acord.models.message.Message]¶
This function is a coroutine.
Create a new message in the channel/thread
- Parameters
content (
str) – Message content, must be below2000chars.files (Union[List[:class:`File`], :class:`File`]) – A file or a list of files to be sent. File must not be closed else an error is raised.
message_reference (Union[
MessageReference]) – A message to reply to, client must be able to read messages in the channel/thread.tts (
bool) – Whether this is a TTS messageembeds (Union[List[:class:`Embed`], :class:`File`]) – An embed or a list of embeds to send
components (List[
ActionRow]) –A list of action rows to send, refer to me for a more detailed guide.
- async trigger_typing() None¶
This function is a coroutine.
Creates a typing indicator in this channel/thread.
- last_pin_timestamp: Optional[datetime.datetime]¶
Last pinned message in thread
- members: Dict[Snowflake, ThreadMember]¶
Mapping of members in thread, fills with each fetch
- rate_limit_per_user: Optional[int]¶
amount of seconds a user has to wait before sending another message
- thread_metadata: ThreadMeta¶
Additional data about thread
ThreadMember¶
- class acord.models.ThreadMember(*, id: acord.models.Snowflake, user_id: acord.models.Snowflake, join_timestamp: datetime.datetime, flags: int)[source]¶
-
- id: acord.models.Snowflake¶
ID of thread
- join_timestamp: datetime.datetime¶
When did this user join this thread
- user_id: acord.models.Snowflake¶
ID of user in thread
ThreadMeta¶
- class acord.models.ThreadMeta(*, archived: bool, archive_timestamp: datetime.datetime, auto_archive_duration: int, locked: bool, invitable: bool = None)[source]¶
- archive_timestamp: datetime.datetime¶
Time of when thread was archived
User¶
- asynccreate_dm
- defmutual_guilds
- asyncsend
- class acord.models.User(*, conn: Any = None, id: int, username: str, discriminator: str, avatar: str = None, bot: bool = None, system: bool = None, mfa_enabled: bool = None, banner: str = None, accent_color: int = None, locale: str = None, verified: bool = None, flags: acord.bases.flags.user.UserFlags = None, premium_type: int = None, public_flags: acord.bases.flags.user.UserFlags = 0, email: str = None, dm_id: acord.models.Snowflake = None)[source]¶
Represents a Discord user.
- id¶
the user’s id
- Type
acord.Snowflake
- flags¶
the user’s account flags
- Type
acord.UserFlags
the type of Nitro subscription on a user’s account
- Type
- public_flags¶
the public flags on a user’s account
- Type
acord.UserFlags
- async send(**data) Any[source]¶
This function is a coroutine.
Automatically creates DM with user and sends message
:param all parameters are the same as
TextChannel.send():
VoiceChannel¶
- class acord.models.VoiceChannel(*, conn: Any = None, id: int, type: acord.bases.flags.channels.ChannelTypes, guild_id: acord.models.Snowflake, name: str, nsfw: bool = False, position: int, permission_overwrites: List[acord.bases.permissions_overwrite.PermissionsOverwrite] = [], bitrate: int, user_limit: int, parent_id: acord.models.Snowflake = None, rtc_region: str = None)[source]¶
- async join(*, self_mute: bool = False, self_deaf: bool = False, wait: bool = True) acord.voice.core.VoiceConnection[source]¶
This function is a coroutine.
Joins this voice channel, shortcut for
Client.update_voice_state.- Parameters
- Returns
Returns a
VoiceConnectionobject,which can directly be passed into a reciever/player
- async leave() None[source]¶
This function is a coroutine.
Leaves voice channel if client is connected, shortcut for
Client.update_voice_state- Raises
VoiceError –
- permission_overwrites: Optional[List[PermissionsOverwrite]]¶
Permissions for channel
VoiceRegion¶
WebhookMessage¶
- asyncadd_reaction
- asyncclear_reactions
- asynccrosspost
- asyncdelete
- asyncedit
- asyncget_reactions
- asyncpin
- asyncrefetch
- asyncremove_reaction
- asyncreply
- asyncunpin
- class acord.models.WebhookMessage(*, conn: Any = None, activity: Any = None, application: acord.models.application.Application = None, attachments: List[acord.models.attachment.Attachment], author: acord.models.user.User, channel_id: int, components: List[acord.bases.components.ActionRow], content: str, edited_timestamp: Optional[Union[bool, datetime.datetime]] = None, embeds: List[acord.bases.embeds.Embed], flags: acord.bases.flags.message.MessageFlags, id: acord.models.Snowflake, interaction: Any = None, guild_id: acord.models.Snowflake = None, member: acord.models.member.Member = None, mentions: List[Union[acord.models.user.User, Any]], mention_everyone: bool, mention_roles: List[Any], mention_channels: List[Any] = None, nonce: int = None, pinned: bool, reactions: Dict[acord.models.partials.PartialEmoji, List[acord.models.message.MessageReaction]] = [], referenced_message: Optional[Union[Message, MessageReference]] = None, thread: Any = None, timestamp: datetime.datetime, tts: bool, type: int, sticker_items: List[acord.models.sticker.Sticker] = None, stickers: List[Any] = None, webhook_id: int = None, webhook: Any = None)[source]¶
- async add_reaction(emoji: Union[str, acord.models.emoji.Emoji]) None¶
Add an emoji to the message. Raises 403 if you lack permissions or 404 if message not found.
- async clear_reactions(*, emoji: Optional[Union[str, acord.models.emoji.Emoji]] = None) None¶
Clear all reactions/x reactions on a message. Raises 403 if you lack permissions or 404 if message not found.
- async crosspost() acord.models.message.Message¶
Crossposts a message in a news channel
- async delete(**kwds) None[source]¶
Deletes this message.
Note
Refer to
Webhook.delete_message()for parameters and additional guidance.
- async edit(*kwds) acord.models.message.WebhookMessage[source]¶
This function is a coroutine.
Edits this message.
Note
Refer to
Webhook.edit_message()for parameters and additional guidance.
- get_reactions(emoji: Union[str, acord.models.emoji.Emoji], *, after: Union[acord.models.user.User, acord.models.Snowflake], limit: int = 25) List[acord.models.user.User]¶
This function is a coroutine.
Fetches users from a reaction
- async refetch() Optional[acord.models.message.Message]¶
This function is a coroutine.
Attempts to fetch the same message from the API again
- async remove_reaction(emoji: Union[str, acord.models.emoji.Emoji], user_id: Union[str, int] = '@me') None¶
Removes a reaction on a message set by a specified user. Raises 403 if you lack permissions or 404 if message not found.
- async reply(**data) acord.models.message.Message¶
Shortcut for Message.Channel.send(…, reference=self)
- activity: Any¶
sent with Rich Presence-related chat embeds
- application: Optional[acord.models.application.Application]¶
sent with Rich Presence-related chat embeds
- attachments: List[acord.models.attachment.Attachment]¶
List of Attachment objects
- author: acord.models.user.User¶
User object of who sent the message
- property channel¶
Returns the channel message was sent in
- components: List[acord.bases.components.ActionRow]¶
List of all components in the message
- embeds: List[acord.bases.embeds.Embed]¶
List of embeds
- flags: acord.bases.flags.message.MessageFlags¶
Message flags
- property guild¶
Returns the guild message was sent in
- guild_id: Optional[acord.models.Snowflake]¶
Guild ID of were message was sent
- id: acord.models.Snowflake¶
Message ID
- interaction: Optional[Any]¶
Message Interaction
- member: Optional[acord.models.member.Member]¶
Member object of who sent the message
- mention_channels: Optional[List[Any]]¶
List of mentioned channels
- mention_roles: List[Any]¶
If message mentioned any roles
- mentions: List[Union[acord.models.user.User, Any]]¶
List of mentioned users
- reactions: Dict[acord.models.partials.PartialEmoji, List[acord.models.message.MessageReaction]]¶
List of reactions
- referenced_message: Optional[Union[acord.models.message.Message, acord.models.message.MessageReference]]¶
Replied message
- sticker_items: Optional[List[acord.models.sticker.Sticker]]¶
List of stickers
- thread: Optional[Any]¶
Thread were message was sent
- timestamp: datetime.datetime¶
List of reactions
- webhook: Any¶
Webhook this message was sent from
WelcomeChannel¶
- class acord.models.WelcomeChannel(*, channel_id: acord.models.Snowflake, description: str, emoji_id: acord.models.Snowflake = None, emoji_name: str)[source]¶