Discord Models¶
Note
The following classes come from the discord.models
package.
Application¶
ApplicationModel
dataclass
¶
Bases: DataModel
Represents a bot application object.
id: int
instance-attribute
¶
ID of the app.
name: str
instance-attribute
¶
Name of the app.
icon: str
instance-attribute
¶
Icon hash of the app.
description: str
instance-attribute
¶
Description of the app.
bot_public: bool
instance-attribute
¶
If other users can add this app to a guild.
bot: UserModel
instance-attribute
¶
Partial user obhect for the bot user associated with the app.
owner: UserModel
instance-attribute
¶
Partial user object for the owner of the app.
guild_id: int
instance-attribute
¶
Guild ID associated with the app (e.g., a support server).
guild: GuildModel
instance-attribute
¶
Partial guild object of the associated guild.
approximate_guild_count: int
instance-attribute
¶
Approximate guild member count.
Emoji¶
EmojiModel
dataclass
¶
Bases: DataModel
Represents a Discord emoji.
name: str
instance-attribute
¶
Name of emoji.
id: int = 0
class-attribute
instance-attribute
¶
ID of the emoji (if custom).
animated: bool = False
class-attribute
instance-attribute
¶
If the emoji is animated. Defaults to False
.
mention: str
property
¶
For use in message content.
api_code: str
property
¶
Return the correct API code for this emoji (URL-safe).
Guild¶
GuildModel
dataclass
¶
Bases: DataModel
Represents a Discord guild.
id: int
instance-attribute
¶
ID of the guild.
name: str
instance-attribute
¶
Name of the guild.
icon: Optional[str] = None
class-attribute
instance-attribute
¶
Icon hash of the guild.
emojis: list[EmojiModel] = None
class-attribute
instance-attribute
¶
List of emojis reigstered in the guild.
approximate_member_count: Optional[int] = None
class-attribute
instance-attribute
¶
Approximate member count.
description: str = None
class-attribute
instance-attribute
¶
Description of the guild.
ReadyGuildModel
dataclass
¶
Integration¶
IntegrationModel
dataclass
¶
Bases: DataModel
Represents a guild integration.
id: int
instance-attribute
¶
ID of the integration.
name: str
instance-attribute
¶
Name of the integration.
enabled: bool
instance-attribute
¶
If the integration is enabled.
application: Optional[ApplicationModel] = None
class-attribute
instance-attribute
¶
The bot aaplication for Discord integrations.
Member¶
MemberModel
dataclass
¶
Bases: DataModel
Represents a guild member.
roles: list[int]
instance-attribute
¶
List of roles registered to the guild member.
user: UserModel
instance-attribute
¶
User data associated with the guild member.
nick: str
instance-attribute
¶
Server nickname of the guild member.
avatar: str
instance-attribute
¶
Server avatar hash of the guild mmeber.
joined_at: str
instance-attribute
¶
ISO8601 timestamp of when the guild member joined server.
deaf: bool
instance-attribute
¶
If the member is deaf in a VC (input).
mute: bool
instance-attribute
¶
If the member is muted in VC (output).
Role¶
RoleModel
dataclass
¶
Bases: DataModel
Represents a Discord role.
id: int
instance-attribute
¶
ID of the role.
name: str
instance-attribute
¶
Name of the role.
colors: RoleColors
instance-attribute
¶
Colors of the role.
hoist: bool
instance-attribute
¶
If the role is pinned in user listing.
position: int
instance-attribute
¶
Position of the role.
permissions: str
instance-attribute
¶
Permission bit set.
managed: bool
instance-attribute
¶
If the role is managed by an integration.
mentionable: bool
instance-attribute
¶
If the role is mentionable.
flags: int
instance-attribute
¶
Role flags combined as a bitfield.
icon: Optional[str] = None
class-attribute
instance-attribute
¶
Icon hash of the role.
unicode_emoji: Optional[str] = None
class-attribute
instance-attribute
¶
Unicode emoji of the role.