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_public: bool

when false only app owner can join the app’s bot to guilds

bot_require_code_grant: bool

when true the app’s bot will only join upon completion of the full oauth2 code grant flow

cover_image: Optional[str]

the application’s default rich presence invite cover image hash

description: str

the description of the app

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

icon: Optional[str]

the icon hash of the app

id: acord.models.Snowflake

ID of the application

name: str

the name of the app

owner: Optional[dict]

partial user object containing info on the owner 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

verify_key: str

the hex encoded key for verification in interactions and the GameSDK’s GetTicket

Attachment

class acord.models.Attachment(*, id: acord.models.Snowflake, filename: str, description: str = None, content_type: str = None, size: int, url: str, proxy_url: str, height: int = None, width: int = None, ephemeral: bool = None)[source]
content_type: Optional[str]

Media type of the attachment

description: Optional[str]

Description of the file

ephemeral: Optional[bool]

Whether the file is ephemeral

filename: str

Name of the attached file

height: Optional[int]

Height of the file (if it’s an image)

id: acord.models.Snowflake

ID of the attachment

proxy_url: str

A proxied URL of the file

size: int

Size of the attachment, in bytes

url: str

Source URL of the file

width: Optional[int]

Width of the file (if its an image)

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

Attributes
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, while AuditLogChange.old_value` is, that means the property that was changed has been reset, or set to None

key: str

name of audit log entry change, for full list of possible changes visit me

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

reason: Optional[str]

the reason for the change

target_id: Optional[str]

ID of affected entity, can be an ID of anything implementing the Hashable class.

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

count: Optional[int]

number of entities targeted

delete_member_days: Optional[int]

number of days after which inactive members were kicked

id: Optional[acord.models.Snowflake]

id of the overwritten entity

members_removed: Optional[int]

number of members removed by the prune

message_id: Optional[acord.models.Snowflake]

id of the message that was targeted

role_name: Optional[str]

name of the role if type is “0” (not present if type is “1”)

type: Optional[str]

type of overwritten entity - “0” for “role” or “1” for “member”

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]
guild_id: Snowflake

ID of guild were category belongs

name: str

Name of category

nsfw: Optional[bool]

Whether the category is marked as NSFW

permission_overwrites: Optional[List[PermissionsOverwrite]]

List of permissions for category

position: int

Position of category

Channel

class acord.models.Channel(*, conn: Any = None, id: int, type: acord.bases.flags.channels.ChannelTypes)[source]

DMChannel

Methods
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

Parameters

message_id (Union[Message, Snowflake]) – ID of the message to fetch

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

Parameters

message_id (Union[Message, Snowflake]) – ID of message to get

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 below 2000 chars.

  • 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 message

  • embeds (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_message_id: Optional[Snowflake]

ID of last message sent in channel

recipients: List[User]

List of users in channel, usually just 1 user

Emoji

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

Parameters
  • name (str) – New name for emoji

  • roles (List[Any]) – List of roles allowed to use emoji

  • reason (str) – Reason for editing emoji, shows in Audit Logs.

is_useable()[source]

Checks whether the client is able to use this emoji

animated: Optional[bool]

Emoji is animated or not

available: Optional[bool]

Can be used or not - Lost due to server boosts

created_at: Optional[datetime.datetime]

When the emoji was created

deleted: Optional[bool]

Whether the emoji has been deleted internally

guild_id: Optional[int]

Guild were emoji belongs to

id: acord.models.Snowflake

ID of Emoji

is_unicode: Optional[bool]

Is a unicode emoji

managed: Optional[bool]

Whether this emoji is managed

name: str

Name of Emoji

require_colons: Optional[bool]

Whether this emoji must be wrapped in colons

roles: Optional[List[acord.models.roles.Role]]

List of roles

user: Optional[acord.models.user.User]

User who created the emoji

GroupDMChannel

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

Parameters

message_id (Union[Message, Snowflake]) – ID of the message to fetch

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

Parameters

message_id (Union[Message, Snowflake]) – ID of message to get

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 below 2000 chars.

  • 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 message

  • embeds (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

last_message_id: Optional[Snowflake]

ID of last message sent in channel

owner_id: Snowflake

ID of group owner

recipients: List[User]

List of users in channel, usually just 1 user

Guild

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.large may be useful to prevent grabbing members which exist but are not cached. This is only applicable when this value is True.

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_token for a User, you may use this method for adding the user to this guild.

Note

Requires guilds.join scope inorder to add the user

Parameters
  • user_id (Union[User, Snowflake]) – User to add to guild

  • access_token (str) – Access token to be used

  • nick (str) – Nickname for user

  • roles (List[Union[Role, Snowflake]]) – List of roles to give user on join

  • mute (bool) – Whether the user is muted in voice channels

  • dead (bool) – Whether the user is deafened in voice channels

  • reason (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 guild

  • name (str) – name of the guild (2-100 characters)

  • icon (File) – image for the guild icon

  • verification_level (VerificationLevel) – verification level for guild

  • default_message_notifications (GuildMessageNotification) – default message notif for guild

  • explicit_content_filter (ExplicitContentFilterLevel) – explicit content filter for guild

  • roles (List[Role]) – list of roles for guild

  • channels (List[PartialChannel]) – list of partial channels for guild

  • afk_channel_id (Snowflake) – id for afk channel

  • afk_timeout (int) – afk timeout in seconds

  • system_channel_id (Snowflake) – the id of the channel where guild notices such as welcome messages and boost events are posted

  • system_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 channel

  • type (ChannelTypes) – Type of channel to create

  • topic (str) – Channel topic

  • bitrate (int) – Bitrate for channel, VOICE ONLY

  • user_limit (int) – User limit for channel, VOICE ONLY

  • rate_limit_per_user (int) – Slowmode for channel

  • position (integer) – Sorting position of channel

  • permission_overwrite (List[PermissionsOverwrite]) – channel permission overwrites

  • parent_id (Snowflake) – id of the parent category for channel

  • nsfw (bool) – Whether to mark channel as NSFW

  • reason (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

Parameters
  • name (str) – name for emoji

  • image (File) – file for image emoji, cannot be greater then 256kB

  • roles (List[Role]) – list of roles allowed to use 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 event

  • entity_type (ScheduledEventEntityType) – the entity type of the scheduled event

  • name (str) – name of the event

  • channel_id (Snowflake) – the channel id of the scheduled event.

  • entity_metadata (ScheduledEventMetaData) – the entity metadata of the scheduled event

  • privacy_level (ScheduledEventPrivacyLevel) – the privacy level of the scheduled event

  • scheduled_start_time (datetime.datetime) – the start time of the scheduled event

  • scheduled_end_time (datetime.datetime) – the end time of the scheduled event

  • description (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

Parameters
  • client (Client) – client being used to create guild

  • code (str) – Template code to create guild from

  • name (str *) – Name of guild

  • icon (File) – Icon for guild

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 to new role

  • permissions (Permissions) – Role permissions

  • color (EmbedColor) – Colour of role, for reference checkout Embed.color

  • hoist (bool) – Whether to display role seperately

  • icon (File) – the role’s icon image

  • unicode_emoji (str) – the role’s icon as a unicode emoji

  • mentionable (bool) – whether the role can be mentioned

  • reason (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

Parameters
  • name (str) – name of sticker

  • description (str) – description of sticker

  • tags (str) – tags for autocompletion of sticker

  • file (File) –

    a file for the sticker image

    Warning

    File size should be below 500kB

async create_template(**data) acord.models.guild_template.GuildTemplate[source]

This function is a coroutine.

Create new guild template

Parameters
  • name (str) – name of template

  • description (str) – description of 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 not

  • welcome_channels (List[WelcomeChannel]) – channels linked in the welcome screen and their display options

  • description (str) – the server description to show in the welcome screen

  • reason (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

Parameters
  • enabled (bool) – whether the widget is enabled

  • channel_id (Snowflake) – the widget channel id

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

Parameters
  • user_id (Snowflake) – Filter actions for only this user

  • action_type (AuditLogEvent) – the type of audit log event

  • before (Snowflake) – filter the log before a certain entry id

  • limit (int) – how many entries are returned (default 50, minimum 1, maximum 100)

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.

Parameters

user_id (Union[User, Snowflake]) – ID of user who was banned

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. Returns io.BytesIO with 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

Parameters

member (Union[Member, Snowflake]) – Member to fetch

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

Parameters
  • limit (int) – How many many members to fetch, must be less then 1000 and greater then 1. Defaults to 1!

  • after (Snowflake) – Fetches users after this user

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)

Parameters
  • query (str) – Username/Nickame to use

  • limit (int) –

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.

Parameters
  • days (int) – number of days to count prune for (1-30)

  • include_roles (List[Role]) – role(s) to include

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

async leave() None[source]

This function is a coroutine.

Leaves this guild

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

Parameters

*positions (RoleMovePayload) –

Arguments of role move payloads, or dict with keys:

Were id is the role ID and position is its new position

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_count is True.

Parameters
  • days (int) – number of days to count prune for (1-30)

  • compute_prune_count (bool) – whether to return amount of members pruned, for larger guilds it is discouraged to use this.

  • include_roles (List[Role]) – role(s) to include

  • reason (str) – Reason for starting prune

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

Parameters

user_id (Union[User, Snowflake]) – user ID to be unbanned

afk_channel_id: Optional[acord.models.Snowflake]

AFK channel id

afk_timeout: Optional[int]

AFK timeout duration

application_id: Optional[acord.models.Snowflake]

application id of the guild creator if it is bot-created

banner: Optional[str]

URL for the guild banner

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

description: Optional[str]

the description of a Community guild

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

features: List[str]

List of guild features

guild_scheduled_events: Dict[acord.models.Snowflake, acord.models.guild_sched_event.GuildScheduledEvent]

List of scheduled guild events

icon: Optional[str]

Guild icon

id: acord.models.Snowflake

Guild ID

joined_at: datetime.datetime

When the user joined this guild, May be None if your fetching from API.

large: bool

Whether this guild is considered as large

max_members: int

Maximum amount of members allowed to join this guild

max_video_channel_users: Optional[int]

The maximum amount of users in a video channel

member_count: int

Amount of members in this guild

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

name: str

Name of guild

nsfw: bool

Whether the guild is marked as NSFW

nsfw_level: acord.bases.enums.guild.NSFWLevel

Guild NSFW level

owner_id: acord.models.Snowflake

ID of the guild owner

preferred_locale: str

the preferred locale of a Community guild

premium_progress_bar_enabled: Optional[bool]

Whether Boosts progress bar is enabled

premium_subscription_count: int

Number of guild boosts

premium_tier: acord.bases.enums.guild.PremiumTierLevel

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

splash: Optional[str]

URL of the guild splash

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_flags: Optional[int]

system channel flags

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

unavailable: Optional[bool]

Whether guild is operational or lost due to outage

vanity_url_code: Optional[str]

the vanity url code for the guild

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

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 delete() None[source]

This function is a coroutine.

Deletes this event

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 event

  • entity_type (ScheduledEventEntityType) – the entity type of the scheduled event

  • name (str) – name of the event

  • channel_id (Snowflake) – the channel id of the scheduled event.

  • entity_metadata (ScheduledEventMetaData) – the entity metadata of the scheduled event

  • privacy_level (ScheduledEventPrivacyLevel) – the privacy level of the scheduled event

  • scheduled_start_time (datetime.datetime) – the start time of the scheduled event

  • scheduled_end_time (datetime.datetime) – the end time of the scheduled event

  • description (str) – the description of the scheduled event

  • status (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 fetch

  • with_member (bool) – ScheduledEventUser.member will contain a member object, of who subcribed to the event

  • before (Snowflake) – consider only users before given user id

  • after (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

description: Optional[str]

description of 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

name: str

name 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

user_count: Optional[int]

the number of users subscribed to 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

Parameters
  • name (str) – name of template

  • description (str) – description of template

async sync() acord.models.guild_template.GuildTemplate[source]

This function is a coroutine.

Syncs current guild template.

code: str

the template code (unique ID)

created_at: str

when this template was created

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

description: Optional[str]

the description for the template

is_dirty: Optional[bool]

whether the template has unsynced changes

name: str

template name

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

updated_at: str

when this template was last synced to the source guild

usage_count: int

number of times this template has been used

GuildWidget

class acord.models.GuildWidget(*, enabled: bool, channel_id: acord.models.Snowflake)[source]

GuildWidgetImageStyle

class acord.models.GuildWidgetImageStyle(value)[source]

An enumeration.

Integration

Methods
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]
async delete(*, reason: Optional[str] = None) None

This function is a coroutine.

Deletes integration

Parameters

reason (str) – Reason for deleting integration

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

class acord.models.IntegrationExpBehaviour(value)[source]

An enumeration.

Interaction

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

token: str

a continuation token for responding to the interaction

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

version: int

read-only property, always 1

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

class acord.models.InteractionSlashOption(*, name: str, type: acord.ext.application_commands.types.ApplicationCommandOptionType, value: Any = None, options: List[InteractionSlashOption] = [], focused: bool = False)[source]

Invite

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 invite

  • code (str) – code of invite to fetch

  • with_counts (bool) – whether the invite should contain approximate member counts

  • with_expiration (bool) – whether the invite should contain the expiration date

  • guild_scheduled_event_id (bool) – the guild scheduled event to include with the invite

approximate_member_count: Optional[int]

approximate count of total members

approximate_presence_count: Optional[int]

approximate count of online members

channel_id: acord.models.Snowflake

the channel this invite is for

code: str

the invite code (unique ID)

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

max_uses: Optional[int]

Number of uses allowed on 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_type: Optional[int]

the type of target for this voice channel invite

target_user: Optional[acord.models.user.User]

the user whose stream to display for this voice channel stream invite

Member

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

User

nick

Guild specific nickname of the member

Type

str

avatar

Member’s guild avatar hash or url

Type

str

roles

List of role IDs of roles the user has

Type

List[Snowflake]

joined_at

The time the user joined the guild

Type

datetime.datetime

premium_since

When the user started boosting the guild

Type

datetime.datetime

deaf

Whether if the member is deafened in voice channels

Type

bool

mute

Whether if the member is mutes in voice channels

Type

bool

pending

Whether if the member is pending verification. Not included in NONE-GUILD-EVENTS events

Type

bool

permissions

Total permissions of the member in the channel. Including overwrites.

Type

str

guild_id

ID of the guild member is in

Type

Snowflake

voice_state

Voice state of a member

Type

MemberVoiceState

presence

Presence of member

Type

MemberPresence

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:

Parameters
  • role (Role) – Role to add to user

  • reason (str) – Reason for adding role

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().

Parameters
  • *roles (Role) – Roles to be updated, must be provided individually as args!

  • reason (str) – Reason for adding roles

async ban(*, reason: Optional[str] = None, delete_message_days: int = 0) None[source]

This function is a coroutine.

Bans this member from the guild

Parameters
  • reason (str) – Reason for banning member

  • delete_message_days (int) – An integer between 0-7, deletes members messages within the past n days.

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 user

  • roles (str) – New roles for members, roles will be updated exactly as provided. If you wish to keep existing roles, use Member.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 to None, 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

Parameters
  • role (Role) – Role to remove

  • reason (str) – Reason for removing role

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().

Parameters
  • *roles (Role) – Roles to be updated, must be provided individually as args!

  • reason (str) – Reason for removing roles

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

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.

Parameters

emoji (Union[str, Emoji]) – The emoji to add, if already on message does nothing

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.

Parameters

emoji (Union[str, Emoji]) – Emoji to clear, defaults to None meaning all

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 message

  • embeds (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_EMBEDS can currently be set/unset

  • allowed_mentions (AllowedMentions) – edit allowed mentions for message

  • files (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

Parameters
  • emoji (Union[str, Emoji]) – Emoji to fetch reactions for

  • after (Union[Snowflake, User]) – Fetches users after this id

  • limit (int) – Amount of users to fetch, any integer from 1 - 100

async pin(*, reason: str = '') None[source]

Adds message to channel pins

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.

Parameters

emoji (Union[str, Emoji]) – Reaction to remove

async reply(**data) acord.models.message.Message[source]

Shortcut for Message.Channel.send(…, reference=self)

async unpin(*, reason: str = '') None[source]

Removes message from channel pins

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

channel_id: int

id of the channel were the message was send

components: List[acord.bases.components.ActionRow]

List of all components in the message

content: str

Message content

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_everyone: bool

If message mentioned @everyone

mention_roles: List[Any]

If message mentioned any roles

mentions: List[Union[acord.models.user.User, Any]]

List of mentioned users

nonce: Optional[int]

used for verifying if message was sent

Type

Message nonce

pinned: bool

Message pinned in channel or not

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

tts: bool

Is a text to speech message

type: int

Message type, e.g. DEFAULT, REPLY

webhook_id: Optional[int]

Webhook ID

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

class acord.models.PartialChannel(*, name: str, type: acord.bases.flags.channels.ChannelTypes)[source]

PartialEmoji

class acord.models.PartialEmoji(*, id: acord.models.Snowflake, name: str, animated: bool)[source]

PartialIntegration

Methods
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]
async delete(*, reason: Optional[str] = None) None[source]

This function is a coroutine.

Deletes integration

Parameters

reason (str) – Reason for deleting integration

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 role

  • permissions (Permissions) – enabled/disabled permissions

  • color (EmbedColor) – Colour of the role

  • hoist (bool) – whether the role should be displayed separately in the sidebar

  • icon (File) – the role’s icon image

  • unicode_emoji (str) – role’s unicode emoji

  • mentionable (bool) – whether the role should be mentionable

  • reason (str) – Reason for deleting role

color: acord.bases.embeds.EmbedColor

Colour of role

guild_id: int

Guild ID of role

hoist: bool

Role is pinned in the user listing

icon: Optional[str]

Role icon URL

id: int

Role ID

managed: bool

Whether this role is managed by an integration

mentionable: bool

Whether role can be mentioned

name: str

Name of role

permissions: acord.bases.flags.permissions.Permissions

Role permissions

position: int

Role position

tags: Optional[acord.models.roles.RoleTags]

Role tags

unicode_emoji: Optional[str]

Role unicode emoji

RoleTags

class acord.models.RoleTags(*, bot_id: acord.models.Snowflake = None, integration_id: acord.models.Snowflake = None, premium_subscriber: Any = None)[source]

ScheduledEventMetaData

Attributes
class acord.models.ScheduledEventMetaData(*, location: str = None)[source]
location: Optional[str]

location were event will take place

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 int and 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

property increment: int

Increment of when this object was made.

property internal_process_id: int

ID of the process that created snowflake.

property internal_worker_id: int

ID of the worker that created snowflake.

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

Parameters
  • reason (str) – reason for editing stage instance

  • topic (str) – new topic for stage instance

  • privacy_level (StagePrivacyLevel) – new privacy level for stage

channel_id: acord.models.Snowflake

The id of the associated Stage channel

discoverable_disabled: bool

Whether or not Stage Discovery is disabled

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

topic: str

The topic of the Stage instance (1-120 characters)

Sticker

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

Parameters
  • name (str) – name of sticker

  • description (str) – description of sticker

  • tags (str) – tags for autocompletion of 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 from

  • sticker_id (Snowflake) – id of sticker to fetch

asset: Optional[str]

DEPRECATED previously the sticker asset hash, now an empty string

available: Optional[bool]

whether this guild sticker can be used, may be false due to loss of Server Boosts

description: Optional[str]

description of the sticker

format_type: int

type of sticker format

guild_id: Optional[acord.models.Snowflake]

id of the guild that owns this sticker

id: acord.models.Snowflake

ID of the sticker

name: str

name of the sticker

pack_id: Optional[acord.models.Snowflake]

for standard stickers, id of the pack the sticker is from

sort_value: Optional[int]

the standard sticker’s sort order within its pack

tags: str

autocomplete/suggestion tags for the sticker (max 200 characters)

type: int

type of sticker

user: Optional[acord.models.user.User]

the user that uploaded the guild sticker

TextChannel

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 purge like method, use messages from TextChannel.fetch_messages().

Parameters
  • messages (Union[Message, Snowflake]) – Messages to be deleted

  • reason (str) – Reason for deleting 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)

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

Parameters

message (Union[Message, Snowflake]) – Message to start thread with

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

Parameters
  • name (str) – Name of new webhook

  • avatar (Avatar) – Avatar for webhook

  • reason (str) – Reason for creating webhook

async edit(**options) Optional[acord.models.channels.base.Channel][source]

This function is a coroutine.

Modifies a guild channel, fires a channel_update event if channel is updated.

Parameters
  • name (str) – New name for the channel

  • type (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 channel

  • topic (str) – Change the channels topic, if you wish to remove it use the MISSING class

  • nsfw (bool) – Whether to mark channel as NSFW

  • ratelimit (int) – Change ratelimit value for channel

  • permission_overwrite (List[PermissionsOverwrite]) – List of permissions to overwrite in the channel

  • category (Union[int, CategoryChannel]) – Move the channel to a different category, use MISSING for no category

  • archive_duration (Literal[0, 60, 1440, 4230, 10080]) – Change the default archive duration on a thread, use MISSING or 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

Parameters

message_id (Union[Message, Snowflake]) – ID of the message to fetch

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

Parameters
  • around (Union[Message, int]) – get messages around this message ID

  • before (Union[Message, int]) – get messages before this message ID

  • after (Union[Message, int]) – get messages after this message ID

  • limit (int) –

    max number of messages to return (1-100).

    Defaults to 50

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

Parameters

channel (Union[Channel, Snowflake]) – Target channel, or channel to recieve messages from this channel.

Returns

  • A dictionary with the keys

  • * channel_id (source channel id)

  • * webhook_id (created target webhook id)

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

Parameters

message_id (Union[Message, Snowflake]) – ID of message to get

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 below 2000 chars.

  • 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 message

  • embeds (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

default_auto_archive_duration: Optional[int]

Default time for threads to be archived

property guild

Returns the guild were channel was created in

guild_id: int

ID of guild were text channel belongs

last_message_id: Optional[int]

Last message in channel, may or may not be valid

last_pin_timestamp: Optional[datetime.datetime]

Last pinned message in channel, may be None

name: str

Name of channel

nsfw: Optional[bool]

Whether channel is marked as NSFW

parent_id: Optional[int]

Category to which the channel belongs to

permission_overwrites: Optional[List[PermissionsOverwrite]]

Channel Permissions

permissions: Optional[str]

String of user permissions

position: int

Text channel position

rate_limit_per_user: Optional[int]

Channel ratelimit

topic: Optional[str]

Channel topic

Thread

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

Parameters

member (Union[Member, Snowflake]) –

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 thread

  • name (str) – New name for thread

  • archived (bool) – Whether the thread should be archived or not

  • auto_archive_duration (int) – New auto archive duration, is set from parent channel OR during creation

  • rate_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
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 as ThreadMember or Member

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

Parameters

message_id (Union[Message, Snowflake]) – ID of the message to fetch

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

Parameters

message_id (Union[Message, Snowflake]) – ID of message to get

async join() None[source]

This function is a coroutine.

Joins current thread

async leave() None[source]

This function is a coroutine.

Leaves current thread

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

Parameters

member (Union[Member, Snowflake]) –

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 below 2000 chars.

  • 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 message

  • embeds (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.

guild_id: Snowflake

Guild id of were thread belongs

id: Snowflake

Thread id

last_message_id: Optional[Snowflake]

Last message sent in thread

last_pin_timestamp: Optional[datetime.datetime]

Last pinned message in thread

member_count: Optional[int]

aprox members in thread, stops counting after 50

members: Dict[Snowflake, ThreadMember]

Mapping of members in thread, fills with each fetch

message_count: Optional[int]

approx amount of message in thread, stops counting after 50

name: str

Name of thread

owner_id: Snowflake

Id of user who created this thread

parent_id: Snowflake

Channel id of were thread was created from

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]
flags: int

Thread member flags

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

archived: bool

Whether the thread has been archived

auto_archive_duration: int

Time for thread to be auto archived

invitable: Optional[bool]

Whether this thread is invite only

locked: bool

Whether this thread has been locked

User

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

username

the user’s username

Type

str

discriminator

the user’s 4-digit discord-tag

Type

str

avatar

the url of the user’s avatar

Type

str

bot

The user is a bot or not

Type

bool

system

whether the user is an Official Discord System user

Type

bool

mfa_enabled

whether the user has two factor enabled on their account

Type

bool

banner

the url of the user’s banner, if they have one

Type

str

accent_colour

the user’s banner color

Type

int

locale

the user’s chosen language option

Type

str

verified

whether the email on this account has been verified

Type

bool

email

the user’s email

Type

str

flags

the user’s account flags

Type

acord.UserFlags

premium_type

the type of Nitro subscription on a user’s account

Type

int

public_flags

the public flags on a user’s account

Type

acord.UserFlags

async create_dm()[source]

This function is a coroutine.

creates a DM with this user

mutual_guilds() List[Any][source]

Return any guilds the user shares with the client

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
  • self_mute (bool) – Whether to mute client on join

  • self_deaf (bool) – Whether to deafen client on join, doesn’t mute unless specified!

  • wait (bool) – Whether to wait for the VoiceConnection to be returned

Returns

  • Returns a VoiceConnection object,

  • 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

bitrate: int

the bitrate (in bits) of the voice channel

guild_id: Snowflake

ID of guild were channel is in

name: str

Name of channel

nsfw: Optional[bool]

Whether channel is marked as NSFW

parent_id: Optional[Snowflake]

ID of category were channel is in

permission_overwrites: Optional[List[PermissionsOverwrite]]

Permissions for channel

position: int

Position of channel

rtc_region: Optional[str]

voice region id for the voice channel, automatic when set to null

user_limit: int

the user limit of the voice channel

VoiceRegion

class acord.models.VoiceRegion(*, id: acord.models.Snowflake, name: str, optimal: bool, depreciated: bool, custom: bool)[source]

WebhookMessage

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.

Parameters

emoji (Union[str, Emoji]) – The emoji to add, if already on message does nothing

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.

Parameters

emoji (Union[str, Emoji]) – Emoji to clear, defaults to None meaning all

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

Parameters
  • emoji (Union[str, Emoji]) – Emoji to fetch reactions for

  • after (Union[Snowflake, User]) – Fetches users after this id

  • limit (int) – Amount of users to fetch, any integer from 1 - 100

async pin(*, reason: str = '') None

Adds message to channel pins

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.

Parameters

emoji (Union[str, Emoji]) – Reaction to remove

async reply(**data) acord.models.message.Message

Shortcut for Message.Channel.send(…, reference=self)

async unpin(*, reason: str = '') None

Removes message from channel pins

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

channel_id: int

id of the channel were the message was send

components: List[acord.bases.components.ActionRow]

List of all components in the message

content: str

Message content

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_everyone: bool

If message mentioned @everyone

mention_roles: List[Any]

If message mentioned any roles

mentions: List[Union[acord.models.user.User, Any]]

List of mentioned users

nonce: Optional[int]

used for verifying if message was sent

Type

Message nonce

pinned: bool

Message pinned in channel or not

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

tts: bool

Is a text to speech message

type: int

Message type, e.g. DEFAULT, REPLY

webhook: Any

Webhook this message was sent from

webhook_id: Optional[int]

Webhook ID

WelcomeChannel

class acord.models.WelcomeChannel(*, channel_id: acord.models.Snowflake, description: str, emoji_id: acord.models.Snowflake = None, emoji_name: str)[source]

WelcomeScreen

class acord.models.WelcomeScreen(*, description: str, welcome_channels: List[Any])[source]