Entities topic

This topic contains classes representing API structures that are the basis of a set of API endpoints or other structures. These will often be subclasses of SnowflakeEntity, for entities that are referenced by a Snowflake ID.

Most entities will have a corresponding Manager that contains parsing for related Models and Dart APIs for related endpoints. For more information, see the Managers topic.

Entities are also Models in that they contain structured data returned by the API. Unlike most models though, entities will often provide methods that act on said entity. These methods are often simply shortcuts to a corresponding Manager method, but calling them on an entity directly often leads to cleaner code.

Entities, like all Models, are immutable structures. Using a method on an entity that updates it (for example WritableSnowflakeEntity.update) will not modify the instance itself; instead, a new instance will be returned by the updating method and should be used instead.

Most entities will have a corresponding "partial" entity. A partial entity is a reference to an entity, and can therefore be used to access that entity's methods (which often only require knowing its ID) without having to fetch the entity's model from the API. Partial entities can be accessed using Manager.operator[] and providing the entity's ID.

For example, you can write the following code to list a Guild's channels without having to fetch the Guild itself:

client.guilds[GUILD_ID].fetchChannels();

You can obtain the full model for a partial entity by using the get method.

Classes

AnnouncementThread Entities Models
Application Entities Models
An OAuth2 application.
ApplicationCommand Entities Models
A command that can be executed by users and is displayed in the Discord client UI.
AuditLogEntry Entities Models
An entry in a Guild's audit log.
AutoModerationRule Entities Models
A rule use for auto-moderation in a Guild.
Channel Entities Models
A channel of any type.
CommandOptionMentionable<T extends CommandOptionMentionable<T>> Entities
A common superclass for entities that can be passed in options of type CommandOptionType.mentionable.
CommandPermissions Entities Models
The permissions for an ApplicationCommand in a guild.
DirectoryChannel Entities Models
A directory channel.
DmChannel Entities Models
A DM channel.
Emoji Entities Models
An emoji. Either a TextEmoji, an ApplicationEmoji or a GuildEmoji.
Entitlement Entities Models
Premium access a user or guild has for an application.
ForumChannel Entities Models
A forum channel.
GlobalSticker Entities Models
A sticker that can be sent in messages. Represents global stickers (default stickers)
GroupDmChannel Entities Models
A DM channel with multiple recipients.
Guild Entities Models
A collection of channels & users.
GuildAnnouncementChannel Entities Models
An announcement channel in a Guild.
GuildCategory Entities Models
A category for organizing other Channels in a Guild.
GuildChannel Entities Models
A channel in a Guild.
GuildEmoji Entities Models
A custom guild emoji.
GuildMediaChannel Entities Models
A channel in a guild in which threads can be posted, similarly to a ForumChannel.
GuildPreview Entities Models
A preview of a Guild.
GuildStageChannel Entities Models
A stage channel.
GuildSticker Entities Models
A sticker that can be sent in messages. Represent stickers added to guild
GuildTextChannel Entities Models
A TextChannel in a Guild.
GuildVoiceChannel Entities Models
A VoiceChannel in a Guild.
HasThreadsChannel Entities Models
A channel which can have threads.
Integration Entities Models
An integration in a Guild.
ManagedSnowflakeEntity<T extends ManagedSnowflakeEntity<T>> Core Entities
The base class for all SnowflakeEntity's that have a dedicated ReadOnlyManager.
Member Entities Models
The representation of a User in a Guild.
Message Entities Models
Represents a message sent in a TextChannel.
PartialApplication Entities
A partial Application object.
PartialApplicationCommand Entities
A partial ApplicationCommand.
PartialAuditLogEntry Entities
A partial AuditLogEntry.
PartialAutoModerationRule Entities
A partial AutoModerationRule.
PartialChannel Entities
A partial Channel object.
PartialEmoji Entities
A partial Emoji object.
PartialEntitlement Entities
A partial Entitlement.
PartialGlobalSticker Entities
PartialGuild Entities
A partial Guild.
PartialGuildSticker Entities
PartialIntegration Entities
A partial Integration.
PartialMember Entities
A partial Member.
PartialMessage Entities
A partial Message object.
PartialRole Entities
A partial Role.
PartialScheduledEvent Entities
A partial ScheduledEvent.
PartialSku Entities
A partial Sku.
PartialSoundboardSound Entities
PartialSubscription Entities
A partial Subscription.
PartialTextChannel Entities
A partial TextChannel.
PartialUser Entities
A partial User object.
PartialWebhook Entities
A partial Webhook.
PrivateThread Entities Models
A private Thread channel.
PublicThread Entities Models
A public Thread channel.
Role Entities Models
A role in a Guild.
ScheduledEvent Entities Models
A scheduled event in a Guild.
Sku Entities Models
A premium offering that can be made available to your application's users or guilds.
SnowflakeEntity<T extends SnowflakeEntity<T>> Core Entities
The base class for all entities in the API identified by a Snowflake.
SoundboardSound Entities Models
StageInstance Entities Models
Information about a live stage.
StickerItem Entities Models
A representation of a sticker with minimal information
StickerPack Entities Models
A Sticker Pack -- group of stickers that are gated behind Nitro.
Subscription Entities Models
A subscription to an Sku.
TextChannel Entities Models
/ A text channel
TextEmoji Entities Models
A text emoji, such as ❤️.
Thread Entities Models
A thread channel.
ThreadsOnlyChannel Entities Models
User Entities Models
A single user, outside of a Guild's context.
UserGuild Entities Models
A collection of channels & users.
VoiceChannel Entities Models
A voice channel.
Webhook Entities Models
A non authenticated way to send messages to a Discord channel.
WritableSnowflakeEntity<T extends WritableSnowflakeEntity<T>> Core Entities
The base class for all SnowflakeEntity's that have a dedicated Manager.