Module prelude

Source
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§

ActionExecution
Gateway event payload sent when a rule is triggered and an action is executed (e.g. message is blocked).
ActionRow
An action row.
Activity
Representation of an activity that a User is performing.
ActivityAssets
The assets for an activity.
ActivityButton
Discord docs.
ActivityEmoji
Representation of an emoji used in a custom status
ActivityFlags
A set of flags defining what is in an activity’s payload.
ActivityParty
Information about an activity’s party.
ActivitySecrets
Secrets for an activity.
ActivityTimestamps
Timestamps of when a user started and/or is ending their activity.
AffectedRole
AfkMetadata
AnswerId
An identifier for a Poll Answer.
ApplicationFlags
The flags of the application.
ApplicationId
An identifier for an Application.
Attachment
A file uploaded with a message. Not to be confused with Embeds.
AttachmentId
An identifier for an attachment.
AuditLogEntry
Discord docs.
AuditLogEntryId
An identifier for an audit log entry.
AuditLogs
Discord docs.
AuthorizingIntegrationOwners
AutoModActionExecutionEvent
Requires GatewayIntents::AUTO_MODERATION_EXECUTION.
AutoModRuleCreateEvent
Requires GatewayIntents::AUTO_MODERATION_CONFIGURATION.
AutoModRuleDeleteEvent
Requires GatewayIntents::AUTO_MODERATION_CONFIGURATION.
AutoModRuleUpdateEvent
Requires GatewayIntents::AUTO_MODERATION_CONFIGURATION.
AutocompleteOption
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.
BulkBanResponse
The response from GuildId::bulk_ban.
Button
A button component.
ChannelCreateEvent
Event data for the channel creation event.
ChannelDeleteEvent
Requires GatewayIntents::GUILDS.
ChannelFlags
Describes extra features of the channel.
ChannelId
An identifier for a Channel
ChannelMention
Discord docs.
ChannelPinsUpdateEvent
Requires GatewayIntents::GUILDS or GatewayIntents::DIRECT_MESSAGES.
ChannelUpdateEvent
Requires GatewayIntents::GUILDS.
ClientStatus
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.
CommandData
The command data payload.
CommandDataOption
A set of a parameter and a value from the user.
CommandDataResolved
The resolved data of a command data interaction payload. It contains the objects of CommandDataOptions.
CommandId
An identifier for a slash command.
CommandInteraction
An interaction when a user invokes a slash command.
CommandOption
The parameters for an Command.
CommandOptionChoice
The only valid values a user can pick in an CommandOption.
CommandPermission
The CommandPermission data.
CommandPermissionId
An identifier for a slash command permission Id.
CommandPermissions
An Command permission.
CommandPermissionsUpdateEvent
Requires no gateway intents.
CommandVersionId
An identifier for a slash command version Id.
ComponentInteraction
An interaction triggered by a message component.
ComponentInteractionData
A message component interaction data, provided by ComponentInteraction::data
Connection
Information about a connection between the current user and a third party service.
CountDetails
A representation of reaction count details.
CurrentApplicationInfo
Information about the current application and its owner.
CurrentUser
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.
EmbedAuthor
An author object in an embed.
EmbedField
A field object in an embed.
EmbedFooter
Footer information for an embed.
EmbedImage
An image object in an embed.
EmbedProvider
The provider of an embed.
EmbedThumbnail
The dimensions and URL of an embed thumbnail.
EmbedVideo
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
EmojiIdentifier
A version of an emoji used only when solely the animated state, Id, and name are known.
EmojiIdentifierParseError
Entitlement
Represents that a user or guild has access to a premium offering in the application.
EntitlementCreateEvent
Requires no gateway intents.
EntitlementDeleteEvent
Requires no gateway intents.
EntitlementId
An identifier for an entitlement.
EntitlementUpdateEvent
Requires no gateway intents.
FollowedChannel
A container for the IDs returned by following a news channel.
ForumTag
An object that represents a tag able to be applied to a thread in a GUILD_FORUM channel.
ForumTagId
An identifier for a forum tag.
Gateway
A representation of the data retrieved from the gateway endpoint.
GatewayIntents
Gateway Intents will limit the events your bot will receive via the gateway. By default, all intents except Privileged Intents are selected.
GenericId
An identifier for an unspecific entity.
Guild
Information about a Discord guild, such as channels, emojis, etc.
GuildAuditLogEntryCreateEvent
Requires GatewayIntents::GUILD_MODERATION and Permissions::VIEW_AUDIT_LOG.
GuildBanAddEvent
Requires GatewayIntents::GUILD_MODERATION.
GuildBanRemoveEvent
Requires GatewayIntents::GUILD_MODERATION.
GuildChannel
Represents a guild’s text, news, or voice channel.
GuildCreateEvent
Requires GatewayIntents::GUILDS.
GuildDeleteEvent
Requires GatewayIntents::GUILDS.
GuildEmojisUpdateEvent
Requires GatewayIntents::GUILD_EMOJIS_AND_STICKERS.
GuildId
An identifier for a Guild
GuildInfo
Variant of Guild returned from Http::get_guilds.
GuildIntegrationsUpdateEvent
Requires GatewayIntents::GUILD_INTEGRATIONS.
GuildMemberAddEvent
Requires GatewayIntents::GUILD_MEMBERS.
GuildMemberFlags
Flags for a guild member.
GuildMemberRemoveEvent
Requires GatewayIntents::GUILD_MEMBERS.
GuildMemberUpdateEvent
Requires GatewayIntents::GUILD_MEMBERS.
GuildMembersChunkEvent
Requires no gateway intents.
GuildPreview
Preview Guild information.
GuildPrune
Representation of the number of members that would be pruned by a guild prune operation.
GuildRoleCreateEvent
Requires GatewayIntents::GUILDS.
GuildRoleDeleteEvent
Requires GatewayIntents::GUILDS.
GuildRoleUpdateEvent
Requires GatewayIntents::GUILDS.
GuildScheduledEventCreateEvent
Requires GatewayIntents::GUILD_SCHEDULED_EVENTS.
GuildScheduledEventDeleteEvent
Requires GatewayIntents::GUILD_SCHEDULED_EVENTS.
GuildScheduledEventUpdateEvent
Requires GatewayIntents::GUILD_SCHEDULED_EVENTS.
GuildScheduledEventUserAddEvent
Requires GatewayIntents::GUILD_SCHEDULED_EVENTS.
GuildScheduledEventUserRemoveEvent
Requires GatewayIntents::GUILD_SCHEDULED_EVENTS.
GuildStickersUpdateEvent
Requires GatewayIntents::GUILD_EMOJIS_AND_STICKERS.
GuildUpdateEvent
Requires GatewayIntents::GUILDS.
GuildWelcomeChannel
A channel shown in the GuildWelcomeScreen.
GuildWelcomeScreen
Information relating to a guild’s welcome screen.
GuildWidget
A Guild widget.
ImageHash
An image hash returned from the Discord API.
Incident
An incident retrieved from the Discord status page.
IncidentUpdate
An update to an incident from the Discord status page.
InputText
An input text component for modal interactions
InstallParams
Settings for the application’s default in-app authorization link
InstallationContextConfig
Information about how the CurrentApplicationInfo is installed.
Integration
Various information about integrations.
IntegrationAccount
Integration account object.
IntegrationApplication
Integration application object.
IntegrationCreateEvent
Requires GatewayIntents::GUILD_INTEGRATIONS.
IntegrationDeleteEvent
Requires GatewayIntents::GUILD_INTEGRATIONS.
IntegrationId
An identifier for an Integration
IntegrationUpdateEvent
Requires GatewayIntents::GUILD_INTEGRATIONS.
InteractionCreateEvent
Requires no gateway intents.
InteractionId
An identifier for an interaction.
InteractionResponseFlags
The flags for an interaction response message.
Invite
Information about an invite code.
InviteChannel
A minimal amount of information about the channel an invite points to.
InviteCreateEvent
Requires GatewayIntents::GUILD_INVITES and [`Permissions::MANAGE_CHANNELS´] permission.
InviteDeleteEvent
Requires GatewayIntents::GUILD_INVITES and [`Permissions::MANAGE_CHANNELS´] permission.
InviteGuild
Subset of Guild used in Invite.
InviteStageInstance
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.
MembersIter
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.
MessageActivity
Rich Presence activity information.
MessageApplication
Rich Presence application information.
MessageCommandInteractionMetadata
MessageComponentInteractionMetadata
MessageCreateEvent
Requires GatewayIntents::GUILD_MESSAGES or GatewayIntents::DIRECT_MESSAGES.
MessageDeleteBulkEvent
Requires GatewayIntents::GUILD_MESSAGES or GatewayIntents::DIRECT_MESSAGES.
MessageDeleteEvent
Requires GatewayIntents::GUILD_MESSAGES or GatewayIntents::DIRECT_MESSAGES.
MessageFlags
Describes extra features of the message.
MessageId
An identifier for a Message
MessageInteraction
Sent when a Message is a response to an Interaction.
MessageModalSubmitInteractionMetadata
MessagePollVoteAddEvent
Requires GatewayIntents::GUILD_MESSAGE_POLLS or GatewayIntents::DIRECT_MESSAGE_POLLS.
MessagePollVoteRemoveEvent
Requires GatewayIntents::GUILD_MESSAGE_POLLS or GatewayIntents::DIRECT_MESSAGE_POLLS.
MessageReaction
A representation of a reaction to a message.
MessageReference
Reference data sent with crossposted messages.
MessageUpdateEvent
Requires GatewayIntents::GUILD_MESSAGES.
MessagesIter
A helper class returned by ChannelId::messages_iter
ModalInteraction
An interaction triggered by a modal submit.
ModalInteractionData
A modal submit interaction data, provided by ModalInteraction::data
Options
Discord docs.
PartialChannel
A container for any partial channel.
PartialCurrentApplicationInfo
Partial information about the given application.
PartialGuild
Partial information about a Guild. This does not include information like member data.
PartialGuildChannel
A partial guild channel.
PartialIntegration
Partial version of Integration, used in AuditLogs::integrations.
PartialMember
A partial amount of data for a member.
PartialThreadMember
PermissionOverwrite
A channel-specific permission overwrite for a member or role.
Permissions
A set of permissions that can be assigned to Users and Roles via PermissionOverwrites, roles globally in a Guild, and to GuildChannels.
PingInteraction
A ping interaction, which can only be received through an endpoint url.
Poll
A poll that has been attached to a Message.
PollAnswer
A possible answer for a Poll.
PollAnswerCount
The count of a single PollAnswer’s results.
PollMedia
A piece of data used in mutliple parts of the Poll structure.
PollResults
The model for the results of a Poll.
Presence
Information detailing the current online status of a User.
PresenceUpdateEvent
Requires GatewayIntents::GUILD_PRESENCES.
PresenceUser
Information about the user of a Presence event.
PresencesReplaceEventDeprecated
Not officially documented.
PrivateChannel
A Direct Message text channel with another user.
Reaction
An emoji reaction to a message.
ReactionAddEvent
Requires GatewayIntents::GUILD_MESSAGE_REACTIONS or GatewayIntents::DIRECT_MESSAGE_REACTIONS.
ReactionConversionError
ReactionRemoveAllEvent
Requires GatewayIntents::GUILD_MESSAGE_REACTIONS or GatewayIntents::DIRECT_MESSAGE_REACTIONS.
ReactionRemoveEmojiEvent
Requires GatewayIntents::GUILD_MESSAGE_REACTIONS or GatewayIntents::DIRECT_MESSAGE_REACTIONS.
ReactionRemoveEvent
Requires GatewayIntents::GUILD_MESSAGE_REACTIONS or GatewayIntents::DIRECT_MESSAGE_REACTIONS.
Ready
An initial set of information given after IDENTIFYing to the gateway.
ReadyEvent
The “Ready” event, containing initial ready cache
ResolvedOption
ResumedEvent
Requires no gateway intents.
RichInvite
Detailed information about an invite.
Role
Information about a role within a guild.
RoleId
An identifier for a Role
RoleSubscriptionData
Discord docs
RoleTags
The tags of a Role.
Rule
Configured auto moderation rule.
RuleId
An identifier for an auto moderation rule
ScheduledEvent
Information about a guild scheduled event.
ScheduledEventId
An identifier for a Scheduled Event
ScheduledEventMetadata
Discord docs.
ScheduledEventUser
Discord docs.
SelectMenu
A select menu component.
SelectMenuOption
A select menu component options.
SessionStartLimit
Information describing how many gateway sessions you can initiate within a ratelimit period.
ShardId
An identifier for a Shard.
ShardInfo
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.
StageInstance
Discord docs.
StageInstanceCreateEvent
Requires GatewayIntents::GUILDS.
StageInstanceDeleteEvent
Requires GatewayIntents::GUILDS.
StageInstanceId
An identifier for a stage channel instance.
StageInstanceUpdateEvent
Requires GatewayIntents::GUILDS.
Sticker
A sticker sent with a message.
StickerId
An identifier for a sticker.
StickerItem
The smallest amount of data required to render a sticker.
StickerPack
A sticker sent with a message.
StickerPackBannerId
An identifier for a sticker pack banner.
StickerPackId
An identifier for a sticker pack.
SystemChannelFlags
Describes a system channel flags.
TargetId
An identifier for a slash command target Id.
Team
Information about the Team group of the application.
TeamMember
Information about a Member on a Team.
ThreadCreateEvent
Requires GatewayIntents::GUILDS.
ThreadDeleteEvent
Requires GatewayIntents::GUILDS.
ThreadListSyncEvent
Requires GatewayIntents::GUILDS.
ThreadMember
A model representing a user in a Guild Thread.
ThreadMemberFlags
Describes extra features of the message.
ThreadMemberUpdateEvent
Requires GatewayIntents::GUILDS, and, to receive this event for other users, GatewayIntents::GUILD_MEMBERS.
ThreadMembersUpdateEvent
Requires GatewayIntents::GUILD_MEMBERS.
ThreadMetadata
A thread data.
ThreadUpdateEvent
Requires GatewayIntents::GUILDS.
ThreadsData
A response to getting several threads channels.
Timestamp
TriggerMetadata
Individual change for trigger metadata within an audit log entry.
TypingStartEvent
Requires GatewayIntents::GUILD_MESSAGE_TYPING or GatewayIntents::DIRECT_MESSAGE_TYPING.
UnavailableGuild
Data for an unavailable guild.
UnknownEvent
User
Information about a user.
UserId
An identifier for a User
UserPublicFlags
User’s public flags
UserUpdateEvent
Sent when properties about the current bot’s user change.
VoiceChannelStatusUpdateEvent
Requires GatewayIntents::GUILDS.
VoiceRegion
Information about an available voice region.
VoiceServerUpdateEvent
Requires no gateway intents.
VoiceState
A user’s state within a voice channel.
VoiceStateUpdateEvent
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.
WebhookChannel
WebhookGuild
The guild object returned by a Webhook, of type WebhookType::ChannelFollower.
WebhookId
An identifier for a Webhook
WebhookUpdateEvent
Requires GatewayIntents::GUILD_WEBHOOKS.

Enums§

Action
An action which will execute whenever a rule is triggered.
ActionRowComponent
A component which can be inside of an ActionRow.
ActionType
See Action
ActivityType
Discord docs.
AfkTimeout
The Guild AFK timeout length.
AuthorizingIntegrationOwner
A cleaned up enum for determining the authorizing owner for an Interaction.
AutoArchiveDuration
See ThreadMetadata::auto_archive_duration.
AutoModAction
Discord docs.
AutomodEventType
Indicates in what event context a rule should be checked.
ButtonKind
ButtonStyle
The style of a button.
Change
Channel
A container for any channel.
ChannelAction
Discord docs.
ChannelOverwriteAction
Discord docs.
ChannelType
A representation of a type of channel.
CommandDataOptionValue
The value of an CommandDataOption.
CommandOptionType
The type of an CommandOption.
CommandPermissionType
The type of a CommandPermission.
CommandType
The type of an application command.
ComponentInteractionDataKind
ComponentType
The type of a component
ConnectionVisibility
The visibility of a user connection on a user’s profile.
CreatorMonetizationAction
Discord docs.
DefaultMessageNotificationLevel
Default message notification level for a guild.
EmojiAction
Discord docs.
EntitlementKind
Differentiates between Entitlement types.
EntitlementOwner
EntityType
EntryPointHandlerType
Signifies how the invocation of a command of type PrimaryEntryPoint should be handled.
Event
Event received over a websocket connection
ExplicitContentFilter
Setting used to filter explicit messages from members.
ForumEmoji
An object that specifies the emoji to use for Forum related emoji parameters.
ForumLayoutType
See GuildChannel::default_forum_layout.
GatewayEvent
Discord docs.
GuildWelcomeChannelEmoji
A GuildWelcomeScreen emoji.
GuildWidgetStyle
ImageHashParseError
An error returned when ImageHash is passed an erronous value.
InputTextStyle
The style of the input text
InstallationContext
An enum representing the [installation contexts].
IntegrationAction
Discord docs.
IntegrationExpireBehaviour
The behavior once the integration expires.
Interaction
Discord docs
InteractionContext
An enum representing the different [interaction contexts].
InteractionType
The type of an Interaction.
InviteAction
Discord docs.
InviteTargetType
Type of target for a voice channel invite.
KeywordPresetType
Internally pre-defined wordsets which will be searched for in content.
MemberAction
Discord docs.
MembershipState
Discord docs.
Mention
A struct that represents some way to insert a notification, link, or emoji into a message.
MentionParseError
MessageAction
Discord docs.
MessageActivityKind
Discord docs.
MessageInteractionMetadata
Metadata about the interaction, including the source of the interaction relevant server and user IDs.
MessageReferenceKind
Message Reference Type information
MessageType
Differentiates between regular and different types of system messages.
MfaLevel
Multi-Factor Authentication level for guild moderators.
ModelError
An error returned from the model module.
Nonce
NsfwLevel
The Guild nsfw level.
OnlineStatus
The representation of a user’s status.
PermissionOverwriteType
The type of edit being made to a Channel’s permissions.
PollLayoutType
Represents the different layouts that a Poll may have.
PollMediaEmoji
The “Partial Emoji” attached to a PollMedia model.
PremiumTier
The guild’s premium tier, depends on the amount of users boosting the guild currently
PremiumType
Premium types denote the level of premium a user has. Visit the Nitro page to learn more about the premium plans Discord currently offers.
ReactionType
The type of a Reaction sent.
ReactionTypes
A list of types a reaction can be.
ResolvedTarget
The resolved value of a CommandData::target_id.
ResolvedValue
The resolved value of a CommandDataOption.
RoleAction
Discord docs.
ScheduledEventAction
Discord docs.
ScheduledEventPrivacyLevel
See ScheduledEvent::privacy_level.
ScheduledEventStatus
Discord docs.
ScheduledEventType
Discord docs.
Scope
The available OAuth2 Scopes.
SkuKind
Differentiates between SKU classes.
SortOrder
The sort order for threads in a forum.
StageInstanceAction
Discord docs.
StageInstancePrivacyLevel
See StageInstance::privacy_level.
StickerAction
Discord docs.
StickerFormatType
Differentiates between sticker formats.
StickerType
Differentiates between sticker types.
TeamMemberRole
ThreadAction
Discord docs.
Trigger
Characterizes the type of content which can trigger the rule.
TriggerType
Type of Trigger.
Unresolved
Option value variants that couldn’t be resolved by CommandData::options().
VerificationLevel
The level to set as criteria prior to a user being able to send messages in a Guild.
VideoQualityMode
The video quality mode for a voice channel.
VoiceChannelStatusAction
Incomplete documentation
WebhookAction
Discord docs.
WebhookType
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§

AttachmentTypeDeprecated
Color