Expand description
The model prelude re-exports all types in the model sub-modules.
This allows for quick and easy access to all of the model types.
§Examples
Import all model types into scope:
use serenity::model::prelude::*;
Structs§
- Action
Execution - Gateway event payload sent when a rule is triggered and an action is executed (e.g. message is blocked).
- Action
Row - An action row.
- Activity
- Representation of an activity that a
User
is performing. - Activity
Assets - The assets for an activity.
- Activity
Button - Discord docs.
- Activity
Emoji - Representation of an emoji used in a custom status
- Activity
Flags - A set of flags defining what is in an activity’s payload.
- Activity
Party - Information about an activity’s party.
- Activity
Secrets - Secrets for an activity.
- Activity
Timestamps - Timestamps of when a user started and/or is ending their activity.
- Affected
Role - AfkMetadata
- Answer
Id - An identifier for a
Poll Answer
. - Application
Flags - The flags of the application.
- Application
Id - An identifier for an Application.
- Attachment
- A file uploaded with a message. Not to be confused with
Embed
s. - Attachment
Id - An identifier for an attachment.
- Audit
LogEntry - Discord docs.
- Audit
LogEntry Id - An identifier for an audit log entry.
- Audit
Logs - Discord docs.
- Authorizing
Integration Owners - Auto
ModAction Execution Event - Requires
GatewayIntents::AUTO_MODERATION_EXECUTION
. - Auto
ModRule Create Event - Requires
GatewayIntents::AUTO_MODERATION_CONFIGURATION
. - Auto
ModRule Delete Event - Requires
GatewayIntents::AUTO_MODERATION_CONFIGURATION
. - Auto
ModRule Update Event - Requires
GatewayIntents::AUTO_MODERATION_CONFIGURATION
. - Autocomplete
Option - The focused option for autocomplete interactions return by
CommandData::autocomplete
. - Ban
- A representation of a banning of a user.
- BotGateway
- A representation of the data retrieved from the bot gateway endpoint.
- Bulk
BanResponse - The response from
GuildId::bulk_ban
. - Button
- A button component.
- Channel
Create Event - Event data for the channel creation event.
- Channel
Delete Event - Requires
GatewayIntents::GUILDS
. - Channel
Flags - Describes extra features of the channel.
- Channel
Id - An identifier for a Channel
- Channel
Mention - Discord docs.
- Channel
Pins Update Event - Requires
GatewayIntents::GUILDS
orGatewayIntents::DIRECT_MESSAGES
. - Channel
Update Event - Requires
GatewayIntents::GUILDS
. - Client
Status - Information detailing the current active status of a
User
. - Colour
- A utility struct to help with working with the basic representation of a colour.
- Command
- The base command model that belongs to an application.
- Command
Data - The command data payload.
- Command
Data Option - A set of a parameter and a value from the user.
- Command
Data Resolved - The resolved data of a command data interaction payload. It contains the objects of
CommandDataOption
s. - Command
Id - An identifier for a slash command.
- Command
Interaction - An interaction when a user invokes a slash command.
- Command
Option - The parameters for an
Command
. - Command
Option Choice - The only valid values a user can pick in an
CommandOption
. - Command
Permission - The
CommandPermission
data. - Command
Permission Id - An identifier for a slash command permission Id.
- Command
Permissions - An
Command
permission. - Command
Permissions Update Event - Requires no gateway intents.
- Command
Version Id - An identifier for a slash command version Id.
- Component
Interaction - An interaction triggered by a message component.
- Component
Interaction Data - A message component interaction data, provided by
ComponentInteraction::data
- Connection
- Information about a connection between the current user and a third party service.
- Count
Details - A representation of reaction count details.
- Current
Application Info - Information about the current application and its owner.
- Current
User - Information about the current user.
- Embed
- Represents a rich embed which allows using richer markdown, multiple fields and more. This was heavily inspired by slack’s attachments.
- Embed
Author - An author object in an embed.
- Embed
Field - A field object in an embed.
- Embed
Footer - Footer information for an embed.
- Embed
Image - An image object in an embed.
- Embed
Provider - The provider of an embed.
- Embed
Thumbnail - The dimensions and URL of an embed thumbnail.
- Embed
Video - Video information for an embed.
- Emoji
- Represents a custom guild emoji, which can either be created using the API, or via an integration. Emojis created using the API only work within the guild it was created in.
- EmojiId
- An identifier for an Emoji
- Emoji
Identifier - A version of an emoji used only when solely the animated state, Id, and name are known.
- Emoji
Identifier Parse Error - Entitlement
- Represents that a user or guild has access to a premium offering in the application.
- Entitlement
Create Event - Requires no gateway intents.
- Entitlement
Delete Event - Requires no gateway intents.
- Entitlement
Id - An identifier for an entitlement.
- Entitlement
Update Event - Requires no gateway intents.
- Followed
Channel - A container for the IDs returned by following a news channel.
- Forum
Tag - An object that represents a tag able to be applied to a thread in a
GUILD_FORUM
channel. - Forum
TagId - An identifier for a forum tag.
- Gateway
- A representation of the data retrieved from the gateway endpoint.
- Gateway
Intents - Gateway Intents will limit the events your bot will receive via the gateway. By default, all intents except Privileged Intents are selected.
- Generic
Id - An identifier for an unspecific entity.
- Guild
- Information about a Discord guild, such as channels, emojis, etc.
- Guild
Audit LogEntry Create Event - Requires
GatewayIntents::GUILD_MODERATION
andPermissions::VIEW_AUDIT_LOG
. - Guild
BanAdd Event - Requires
GatewayIntents::GUILD_MODERATION
. - Guild
BanRemove Event - Requires
GatewayIntents::GUILD_MODERATION
. - Guild
Channel - Represents a guild’s text, news, or voice channel.
- Guild
Create Event - Requires
GatewayIntents::GUILDS
. - Guild
Delete Event - Requires
GatewayIntents::GUILDS
. - Guild
Emojis Update Event - Requires
GatewayIntents::GUILD_EMOJIS_AND_STICKERS
. - GuildId
- An identifier for a Guild
- Guild
Info - Variant of
Guild
returned fromHttp::get_guilds
. - Guild
Integrations Update Event - Requires
GatewayIntents::GUILD_INTEGRATIONS
. - Guild
Member AddEvent - Requires
GatewayIntents::GUILD_MEMBERS
. - Guild
Member Flags - Flags for a guild member.
- Guild
Member Remove Event - Requires
GatewayIntents::GUILD_MEMBERS
. - Guild
Member Update Event - Requires
GatewayIntents::GUILD_MEMBERS
. - Guild
Members Chunk Event - Requires no gateway intents.
- Guild
Preview - Preview
Guild
information. - Guild
Prune - Representation of the number of members that would be pruned by a guild prune operation.
- Guild
Role Create Event - Requires
GatewayIntents::GUILDS
. - Guild
Role Delete Event - Requires
GatewayIntents::GUILDS
. - Guild
Role Update Event - Requires
GatewayIntents::GUILDS
. - Guild
Scheduled Event Create Event - Requires
GatewayIntents::GUILD_SCHEDULED_EVENTS
. - Guild
Scheduled Event Delete Event - Requires
GatewayIntents::GUILD_SCHEDULED_EVENTS
. - Guild
Scheduled Event Update Event - Requires
GatewayIntents::GUILD_SCHEDULED_EVENTS
. - Guild
Scheduled Event User AddEvent - Requires
GatewayIntents::GUILD_SCHEDULED_EVENTS
. - Guild
Scheduled Event User Remove Event - Requires
GatewayIntents::GUILD_SCHEDULED_EVENTS
. - Guild
Stickers Update Event - Requires
GatewayIntents::GUILD_EMOJIS_AND_STICKERS
. - Guild
Update Event - Requires
GatewayIntents::GUILDS
. - Guild
Welcome Channel - A channel shown in the
GuildWelcomeScreen
. - Guild
Welcome Screen - Information relating to a guild’s welcome screen.
- Guild
Widget - A
Guild
widget. - Image
Hash - An image hash returned from the Discord API.
- Incident
- An incident retrieved from the Discord status page.
- Incident
Update - An update to an incident from the Discord status page.
- Input
Text - An input text component for modal interactions
- Install
Params - Settings for the application’s default in-app authorization link
- Installation
Context Config - Information about how the
CurrentApplicationInfo
is installed. - Integration
- Various information about integrations.
- Integration
Account - Integration account object.
- Integration
Application - Integration application object.
- Integration
Create Event - Requires
GatewayIntents::GUILD_INTEGRATIONS
. - Integration
Delete Event - Requires
GatewayIntents::GUILD_INTEGRATIONS
. - Integration
Id - An identifier for an Integration
- Integration
Update Event - Requires
GatewayIntents::GUILD_INTEGRATIONS
. - Interaction
Create Event - Requires no gateway intents.
- Interaction
Id - An identifier for an interaction.
- Interaction
Response Flags - The flags for an interaction response message.
- Invite
- Information about an invite code.
- Invite
Channel - A minimal amount of information about the channel an invite points to.
- Invite
Create Event - Requires
GatewayIntents::GUILD_INVITES
and [`Permissions::MANAGE_CHANNELS´] permission. - Invite
Delete Event - Requires
GatewayIntents::GUILD_INVITES
and [`Permissions::MANAGE_CHANNELS´] permission. - Invite
Guild - Subset of
Guild
used inInvite
. - Invite
Stage Instance - Discord docs.
- Maintenance
- A Discord status maintenance message. This can be either for active maintenances or for scheduled maintenances.
- Member
- Information about a member of a guild.
- Members
Iter - A helper class returned by
GuildId::members_iter
- Message
- A representation of a message over a guild’s text channel, a group, or a private channel.
- Message
Activity - Rich Presence activity information.
- Message
Application - Rich Presence application information.
- Message
Command Interaction Metadata - Message
Component Interaction Metadata - Message
Create Event - Requires
GatewayIntents::GUILD_MESSAGES
orGatewayIntents::DIRECT_MESSAGES
. - Message
Delete Bulk Event - Requires
GatewayIntents::GUILD_MESSAGES
orGatewayIntents::DIRECT_MESSAGES
. - Message
Delete Event - Requires
GatewayIntents::GUILD_MESSAGES
orGatewayIntents::DIRECT_MESSAGES
. - Message
Flags - Describes extra features of the message.
- Message
Id - An identifier for a Message
- Message
Interaction - Sent when a
Message
is a response to anInteraction
. - Message
Modal Submit Interaction Metadata - Message
Poll Vote AddEvent - Requires
GatewayIntents::GUILD_MESSAGE_POLLS
orGatewayIntents::DIRECT_MESSAGE_POLLS
. - Message
Poll Vote Remove Event - Requires
GatewayIntents::GUILD_MESSAGE_POLLS
orGatewayIntents::DIRECT_MESSAGE_POLLS
. - Message
Reaction - A representation of a reaction to a message.
- Message
Reference - Reference data sent with crossposted messages.
- Message
Update Event - Requires
GatewayIntents::GUILD_MESSAGES
. - Messages
Iter - A helper class returned by
ChannelId::messages_iter
- Modal
Interaction - An interaction triggered by a modal submit.
- Modal
Interaction Data - A modal submit interaction data, provided by
ModalInteraction::data
- Options
- Discord docs.
- Partial
Channel - A container for any partial channel.
- Partial
Current Application Info - Partial information about the given application.
- Partial
Guild - Partial information about a
Guild
. This does not include information like member data. - Partial
Guild Channel - A partial guild channel.
- Partial
Integration - Partial version of
Integration
, used inAuditLogs::integrations
. - Partial
Member - A partial amount of data for a member.
- Partial
Thread Member - Permission
Overwrite - A channel-specific permission overwrite for a member or role.
- Permissions
- A set of permissions that can be assigned to
User
s andRole
s viaPermissionOverwrite
s, roles globally in aGuild
, and toGuildChannel
s. - Ping
Interaction - A ping interaction, which can only be received through an endpoint url.
- Poll
- A poll that has been attached to a
Message
. - Poll
Answer - A possible answer for a
Poll
. - Poll
Answer Count - The count of a single
PollAnswer
’s results. - Poll
Media - A piece of data used in mutliple parts of the
Poll
structure. - Poll
Results - The model for the results of a
Poll
. - Presence
- Information detailing the current online status of a
User
. - Presence
Update Event - Requires
GatewayIntents::GUILD_PRESENCES
. - Presence
User - Information about the user of a
Presence
event. - Presences
Replace Event Deprecated - Not officially documented.
- Private
Channel - A Direct Message text channel with another user.
- Reaction
- An emoji reaction to a message.
- Reaction
AddEvent - Requires
GatewayIntents::GUILD_MESSAGE_REACTIONS
orGatewayIntents::DIRECT_MESSAGE_REACTIONS
. - Reaction
Conversion Error - Reaction
Remove AllEvent - Requires
GatewayIntents::GUILD_MESSAGE_REACTIONS
orGatewayIntents::DIRECT_MESSAGE_REACTIONS
. - Reaction
Remove Emoji Event - Requires
GatewayIntents::GUILD_MESSAGE_REACTIONS
orGatewayIntents::DIRECT_MESSAGE_REACTIONS
. - Reaction
Remove Event - Requires
GatewayIntents::GUILD_MESSAGE_REACTIONS
orGatewayIntents::DIRECT_MESSAGE_REACTIONS
. - Ready
- An initial set of information given after IDENTIFYing to the gateway.
- Ready
Event - The “Ready” event, containing initial ready cache
- Resolved
Option - Resumed
Event - Requires no gateway intents.
- Rich
Invite - Detailed information about an invite.
- Role
- Information about a role within a guild.
- RoleId
- An identifier for a Role
- Role
Subscription Data - Discord docs
- Role
Tags - The tags of a
Role
. - Rule
- Configured auto moderation rule.
- RuleId
- An identifier for an auto moderation rule
- Scheduled
Event - Information about a guild scheduled event.
- Scheduled
Event Id - An identifier for a Scheduled Event
- Scheduled
Event Metadata - Discord docs.
- Scheduled
Event User - Discord docs.
- Select
Menu - A select menu component.
- Select
Menu Option - A select menu component options.
- Session
Start Limit - Information describing how many gateway sessions you can initiate within a ratelimit period.
- ShardId
- An identifier for a Shard.
- Shard
Info - Sku
- A premium offering that can be made available to an application’s users and guilds.
- SkuFlags
- Differentates between user and server subscriptions.
- SkuId
- An identifier for a SKU.
- Stage
Instance - Discord docs.
- Stage
Instance Create Event - Requires
GatewayIntents::GUILDS
. - Stage
Instance Delete Event - Requires
GatewayIntents::GUILDS
. - Stage
Instance Id - An identifier for a stage channel instance.
- Stage
Instance Update Event - Requires
GatewayIntents::GUILDS
. - Sticker
- A sticker sent with a message.
- Sticker
Id - An identifier for a sticker.
- Sticker
Item - The smallest amount of data required to render a sticker.
- Sticker
Pack - A sticker sent with a message.
- Sticker
Pack Banner Id - An identifier for a sticker pack banner.
- Sticker
Pack Id - An identifier for a sticker pack.
- System
Channel Flags - Describes a system channel flags.
- Target
Id - An identifier for a slash command target Id.
- Team
- Information about the Team group of the application.
- Team
Member - Information about a Member on a Team.
- Thread
Create Event - Requires
GatewayIntents::GUILDS
. - Thread
Delete Event - Requires
GatewayIntents::GUILDS
. - Thread
List Sync Event - Requires
GatewayIntents::GUILDS
. - Thread
Member - A model representing a user in a Guild Thread.
- Thread
Member Flags - Describes extra features of the message.
- Thread
Member Update Event - Requires
GatewayIntents::GUILDS
, and, to receive this event for other users,GatewayIntents::GUILD_MEMBERS
. - Thread
Members Update Event - Requires
GatewayIntents::GUILD_MEMBERS
. - Thread
Metadata - A thread data.
- Thread
Update Event - Requires
GatewayIntents::GUILDS
. - Threads
Data - A response to getting several threads channels.
- Timestamp
- Trigger
Metadata - Individual change for trigger metadata within an audit log entry.
- Typing
Start Event - Requires
GatewayIntents::GUILD_MESSAGE_TYPING
orGatewayIntents::DIRECT_MESSAGE_TYPING
. - Unavailable
Guild - Data for an unavailable guild.
- Unknown
Event - User
- Information about a user.
- UserId
- An identifier for a User
- User
Public Flags - User’s public flags
- User
Update Event - Sent when properties about the current bot’s user change.
- Voice
Channel Status Update Event - Requires
GatewayIntents::GUILDS
. - Voice
Region - Information about an available voice region.
- Voice
Server Update Event - Requires no gateway intents.
- Voice
State - A user’s state within a voice channel.
- Voice
State Update Event - Requires
GatewayIntents::GUILD_VOICE_STATES
. - Webhook
- A representation of a webhook, which is a low-effort way to post messages to channels. They do not necessarily require a bot user or authentication to use.
- Webhook
Channel - Webhook
Guild - The guild object returned by a
Webhook
, of typeWebhookType::ChannelFollower
. - Webhook
Id - An identifier for a
Webhook
- Webhook
Update Event - Requires
GatewayIntents::GUILD_WEBHOOKS
.
Enums§
- Action
- An action which will execute whenever a rule is triggered.
- Action
RowComponent - A component which can be inside of an
ActionRow
. - Action
Type - See
Action
- Activity
Type - Discord docs.
- AfkTimeout
- The
Guild
AFK timeout length. - Authorizing
Integration Owner - A cleaned up enum for determining the authorizing owner for an
Interaction
. - Auto
Archive Duration - See
ThreadMetadata::auto_archive_duration
. - Auto
ModAction - Discord docs.
- Automod
Event Type - Indicates in what event context a rule should be checked.
- Button
Kind - Button
Style - The style of a button.
- Change
- Channel
- A container for any channel.
- Channel
Action - Discord docs.
- Channel
Overwrite Action - Discord docs.
- Channel
Type - A representation of a type of channel.
- Command
Data Option Value - The value of an
CommandDataOption
. - Command
Option Type - The type of an
CommandOption
. - Command
Permission Type - The type of a
CommandPermission
. - Command
Type - The type of an application command.
- Component
Interaction Data Kind - Component
Type - The type of a component
- Connection
Visibility - The visibility of a user connection on a user’s profile.
- Creator
Monetization Action - Discord docs.
- Default
Message Notification Level - Default message notification level for a guild.
- Emoji
Action - Discord docs.
- Entitlement
Kind - Differentiates between Entitlement types.
- Entitlement
Owner - Entity
Type - Entry
Point Handler Type - Signifies how the invocation of a command of type
PrimaryEntryPoint
should be handled. - Event
- Event received over a websocket connection
- Explicit
Content Filter - Setting used to filter explicit messages from members.
- Forum
Emoji - An object that specifies the emoji to use for Forum related emoji parameters.
- Forum
Layout Type - See
GuildChannel::default_forum_layout
. - Gateway
Event - Discord docs.
- Guild
Welcome Channel Emoji - A
GuildWelcomeScreen
emoji. - Guild
Widget Style - Image
Hash Parse Error - An error returned when
ImageHash
is passed an erronous value. - Input
Text Style - The style of the input text
- Installation
Context - An enum representing the [installation contexts].
- Integration
Action - Discord docs.
- Integration
Expire Behaviour - The behavior once the integration expires.
- Interaction
- Discord docs
- Interaction
Context - An enum representing the different [interaction contexts].
- Interaction
Type - The type of an Interaction.
- Invite
Action - Discord docs.
- Invite
Target Type - Type of target for a voice channel invite.
- Keyword
Preset Type - Internally pre-defined wordsets which will be searched for in content.
- Member
Action - Discord docs.
- Membership
State - Discord docs.
- Mention
- A struct that represents some way to insert a notification, link, or emoji into a message.
- Mention
Parse Error - Message
Action - Discord docs.
- Message
Activity Kind - Discord docs.
- Message
Interaction Metadata - Metadata about the interaction, including the source of the interaction relevant server and user IDs.
- Message
Reference Kind - Message Reference Type information
- Message
Type - Differentiates between regular and different types of system messages.
- MfaLevel
- Multi-Factor Authentication level for guild moderators.
- Model
Error - An error returned from the
model
module. - Nonce
- Nsfw
Level - The
Guild
nsfw level. - Online
Status - The representation of a user’s status.
- Permission
Overwrite Type - The type of edit being made to a Channel’s permissions.
- Poll
Layout Type - Represents the different layouts that a
Poll
may have. - Poll
Media Emoji - The “Partial Emoji” attached to a
PollMedia
model. - Premium
Tier - The guild’s premium tier, depends on the amount of users boosting the guild currently
- Premium
Type - Premium types denote the level of premium a user has. Visit the Nitro page to learn more about the premium plans Discord currently offers.
- Reaction
Type - The type of a
Reaction
sent. - Reaction
Types - A list of types a reaction can be.
- Resolved
Target - The resolved value of a
CommandData::target_id
. - Resolved
Value - The resolved value of a
CommandDataOption
. - Role
Action - Discord docs.
- Scheduled
Event Action - Discord docs.
- Scheduled
Event Privacy Level - See
ScheduledEvent::privacy_level
. - Scheduled
Event Status - Discord docs.
- Scheduled
Event Type - Discord docs.
- Scope
- The available OAuth2 Scopes.
- SkuKind
- Differentiates between SKU classes.
- Sort
Order - The sort order for threads in a forum.
- Stage
Instance Action - Discord docs.
- Stage
Instance Privacy Level - See
StageInstance::privacy_level
. - Sticker
Action - Discord docs.
- Sticker
Format Type - Differentiates between sticker formats.
- Sticker
Type - Differentiates between sticker types.
- Team
Member Role - Thread
Action - Discord docs.
- Trigger
- Characterizes the type of content which can trigger the rule.
- Trigger
Type - Type of
Trigger
. - Unresolved
- Option value variants that couldn’t be resolved by
CommandData::options()
. - Verification
Level - The level to set as criteria prior to a user being able to send
messages in a
Guild
. - Video
Quality Mode - The video quality mode for a voice channel.
- Voice
Channel Status Action - Incomplete documentation
- Webhook
Action - Discord docs.
- Webhook
Type - A representation of a type of webhook.
Constants§
- PRESET_
GENERAL - Returns a set of permissions with the original @everyone permissions set to true.
- PRESET_
TEXT - Returns a set of text-only permissions with the original
@everyone
permissions set to true. - PRESET_
VOICE - Returns a set of voice-only permissions with the original
@everyone
permissions set to true.
Traits§
- Mentionable
- Allows something - such as a channel or role - to be mentioned in a message.
Type Aliases§
- Attachment
Type Deprecated - Color