Bases¶
Bases are objects which represent different objects in the discord API. They minify the code written and can help improve readability in your code!
ActionRow¶
Activity¶
ActivityType¶
AllowedMentions¶
ApplicationCommandType¶
ApplicationFlags¶
AuditLogEvent¶
BaseFlagMeta¶
ChannelTypes¶
Component¶
ComponentTypes¶
Embed¶
- acord.bases.Embed(*, title: Optional[str] = None, type: Optional[Literal['rich', 'image', 'video', 'gifv', 'article', 'link']] = 'rich', description: Optional[str] = None, url: Optional[acord.bases.embeds.DiscordImageURL] = None, timestamp: Optional[datetime.datetime] = None, colour: acord.bases.embeds.EmbedColor = None, footer: Optional[acord.bases.embeds.EmbedFooter] = None, image: Optional[acord.bases.embeds.EmbedImage] = None, thumbnail: Optional[acord.bases.embeds.EmbedThumbnail] = None, video: Optional[acord.bases.embeds.EmbedVideo] = None, providor: Optional[acord.bases.embeds.EmbedProvidor] = None, author: Optional[acord.bases.embeds.EmbedAuthor] = None, fields: List[acord.bases.embeds.EmbedField] = []) None[source]¶
EmbedColor¶
- acord.bases.EmbedColor(color) None[source]¶
Mixin to provide __str__, __repr__, and __pretty__ methods. See #884 for more details.
__pretty__ is used by [devtools](https://python-devtools.helpmanual.io/) to provide human readable representations of objects.
EmbedField¶
EmbedImage¶
EmbedProvidor¶
EmbedThumbnail¶
EmbedVideo¶
ExplicitContentFilterLevel¶
File¶
GuildMessageNotification¶
Hashable¶
IMessageFlags¶
Intents¶
- acord.bases.Intents(value: int = 0, **kwds: Dict[str, bool])[source]¶
Intents are used for accessing certain content through the gateway, without them many of the events wouldn’t work as expected
Usage
All intents are assigned as a attribute, to combine intents, use the
|operator, as shown below.from acord import Intents myIntents = ( Intents.GUILDS | Intents.GUILD_MESSAGES | Intents.GUILD_PRESENCES ... )If bitwise operators are not to your taste, you can try using
BaseFlagMeta.__call__().Valid Attributes
Listed below are the allowed intent attrs and what events they allow to be used
- NONE
No intents
- ALL
Every intent allowed through the gateway
- GUILDS
GUILD_CREATE
GUILD_UPDATE
GUILD_DELETE
GUILD_ROLE_CREATE
GUILD_ROLE_UPDATE
GUILD_ROLE_DELETE
CHANNEL_CREATE
CHANNEL_UPDATE
CHANNEL_DELETE
CHANNEL_PINS_UPDATE
THREAD_CREATE
THREAD_UPDATE
THREAD_DELETE
THREAD_LIST_SYNC
THREAD_MEMBER_UPDATE
THREAD_MEMBERS_UPDATE
STAGE_INSTANCE_CREATE
STAGE_INSTANCE_UPDATE
STAGE_INSTANCE_DELETE
- GUILD_MEMBERS
GUILD_MEMBER_ADD
GUILD_MEMBER_UPDATE
GUILD_MEMBER_REMOVE
THREAD_MEMBERS_UPDATE
- GUILD_BANS
GUILD_BAN_ADD
GUILD_BAN_REMOVE
- GUILD_EMOJIS_AND_STICKERS
GUILD_EMOJIS_UPDATE
GUILD_STICKERS_UPDATE
- GUILD_INTEGRATIONS
GUILD_INTEGRATIONS_UPDATE
INTEGRATION_CREATE
INTEGRATION_UPDATE
INTEGRATION_DELETE
- GUILD_WEBHOOKS
WEBHOOKS_UPDATE
- GUILD_INVITES
INVITE_CREATE
INVITE_DELETE
- GUILD_VOICE_STATES
VOICE_STATE_UPDATE
- GUILD_PRESENCES
PRESENCE_UPDATE
- GUILD_MESSAGES
MESSAGE_CREATE
MESSAGE_UPDATE
MESSAGE_DELETE
MESSAGE_DELETE_BULK
- GUILD_MESSAGE_REACTIONS
MESSAGE_REACTION_ADD
MESSAGE_REACTION_REMOVE
MESSAGE_REACTION_REMOVE_ALL
MESSAGE_REACTION_REMOVE_EMOJI
- GUILD_MESSAGE_TYPING
TYPING_START
- DIRECT_MESSAGES
MESSAGE_CREATE
MESSAGE_UPDATE
MESSAGE_DELETE
CHANNEL_PINS_UPDATE
- DIRECT_MESSAGE_REACTIONS
MESSAGE_REACTION_ADD
MESSAGE_REACTION_REMOVE
MESSAGE_REACTION_REMOVE_ALL
MESSAGE_REACTION_REMOVE_EMOJI
- DIRECT_MESSAGE_TYPING
TYPING_START
InteractionCallback¶
InteractionType¶
MFALevel¶
MessageFlags¶
- acord.bases.MessageFlags(value: int = 0, **kwds: Dict[str, bool])[source]¶
Message flags are used by discord to parse your message in a specified way.
Example
For example,
MessageFlags.SUPPRESS_EMBEDStells discord to not allow embedsAll message flags are assigned as a attribute, to combine flags, use the
|operator, as shown below.from acord import MessageFlags myFlags = ( MessageFlags.CROSSPOSTED | MessageFlags.IS_CROSSPOSTED ... )If bitwise operators are not to your taste, you can try using
BaseFlagMeta.__call__().
Modal¶
NSFWLevel¶
Permissions¶
- acord.bases.Permissions(value: int = 0, **kwds: Dict[str, bool])[source]¶
Permissions define what actions a user can or cannot do, they are set and follow a hierarchy. If you try break the hierarchy 403 will be raised. E.g. Banning a member with a higher role then the client.
Usage
from acord import Permissions permissions = ( Permissions.MANAGE_MESSAGES | Permissions.BAN_MEMBER | Permissions.KICK_MEMBERS )If bitwise operators are not to your taste, you can try using
BaseFlagMeta.__call__().
PermissionsOverwrite¶
Presence¶
ScheduledEventEntityType¶
ScheduledEventPrivacyLevel¶
ScheduledEventStatus¶
SelectOption¶
StagePrivacyLevel¶
StatusType¶
SystemChannelFlags¶
TextInput¶
- acord.bases.TextInput(*, type: acord.bases.enums.components.ComponentTypes, custom_id: Optional[str] = None, style: acord.bases.enums.components.TextInputStyle, label: str, min_length: Optional[int] = None, max_length: Optional[int] = None, required: Optional[bool] = False, value: Optional[str] = None, placeholder: Optional[str] = None) None[source]¶
TextInputStyle¶
UserFlags¶
- acord.bases.UserFlags(value: int = 0, **kwds: Dict[str, bool])[source]¶
User flags allow you to identify users based on there badges given by discord
Usage
Checking for single flags
from acord import UserFlags isStaff = User.flags & UserFlags.STAFF == UserFlags.STAFFHowever, when checking for multiple flags, you need to use the
|for all flags you wantfrom acord import UserFlags flags = ( UserFlags.STAFF | UserFlags.PARTNER ) hasFlags = User.flags & flags == flagsIf bitwise operators are not to your taste, you can try using
BaseFlagMeta.__call__().
- acord.bases.NONE¶
Value of 0, or NO flags
- acord.bases.STAFF¶
discord staff flag
- acord.bases.PARTNER¶
discord partner flag
- acord.bases.HYPESQUAD¶
hypesquad events coordinator flag
- acord.bases.HYPESQUAD_BRAVERY¶
hypesquad house bravery flag
- acord.bases.HYPESQUAD_BRILLIANCE¶
hypesquad house brilliance flag
- acord.bases.HYPESQUAD_BALANCE¶
hypesquad house bravery flag
- acord.bases.BUG_HUNTER_LEVEL_1¶
bug hunter level 1 flag
- acord.bases.BUG_HINTER_LEVEL_2¶
bug hunter level 2 flag
- acord.bases.PREMIUM_EARLY_SUPPORTER¶
early Nitro Supporter
- acord.bases.TEAM_PSEUDO_USER¶
user is a
Team
- acord.bases.VERIFIED_BOT¶
verified bot flag
- acord.bases.VERIFIED_DEVELOPER¶
early verified bot developer flag
- acord.bases.CERTIFIED_MODERATOR¶
discord certified moderator flag