Module serenity::model [] [src]

Mappings of objects received from the API, with optional helper methods for ease of use.

Models can optionally have additional helper methods compiled, by enabling the methods feature.

Methods like Message::delete or Webhook::execute are provided with this feature, which can be shorthands for operations that are otherwise in the Context, or the much lower-level rest module.

Reexports

pub use self::permissions::Permissions;

Modules

event

All the events this library handles.

permissions

A set of permissions for a role or user. These can be assigned directly to a role or as a channel's permission overrides.

Structs

AffectedComponent

A component that was affected during a service incident. This is pulled from the Discord status page.

ApplicationInfo

Information about a user's application. An application does not necessarily have an associated bot user.

Attachment

A file uploaded with a message. Not to be confused with embeds.

Ban

A representation of a banning of a user.

BotApplication

Information about an application with an application's bot user.

BotGateway

A representation of the data retrieved from the bot gateway endpoint.

Call

An active group or private call. These are different from voice channels in guilds.

ChannelId

An identifier for a Channel

ChannelOverride

An override for a channel.

CurrentApplicationInfo

Information about the current application and its owner.

CurrentUser

Information about the current user

Embed

An embed in a message, such as for a URL or an attachment.

EmbedAuthor

An author object in an Embed.

EmbedField

A field object in an Embed.

EmbedFooter

Footer information about 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

A video information object in an Embed.

Emoji

A custom emoji for a guild.

EmojiId

An identifier for an Emoji

FriendSourceFlags

Flags about who may or may not add the current user as a friend.

Game

Information about a game that a user is playing

Gateway

A representation of the data retrieved from the gateway endpoint.

Group

A group channel, potentially including other users, separate from a server.

Guild

Live server information

GuildChannel

A guild's voice or text channel.

GuildEmbed

Information relating to a guild's embed.

GuildId

An identifier for a Guild

GuildInfo

Basic information about a server

GuildPrune

Representation of the number of members that would be pruned by a guild prune operation.

Incident

An incident retrieved from the Discord status page. This is not necessarily a representation of an ongoing incident.

IncidentUpdate

An update to an incident from the Discord status page. This will typically state what new information has been discovered about an incident.

Integration

Holds various information about integrations.

IntegrationAccount

Integration Account Object

IntegrationId

An identifier for an Integration

Invite

Information about an invite.

InviteChannel

Minimal information about the channel an invite points to.

InviteGuild

A minimal amount of information about an invite's guild.

Maintenance

A Discord status maintenance message. This can be either for active maintenances or for scheduled maintenances.

Member

Information about a member of a server

Mention

A mention targeted at a certain model.

Message

A representation of a message sent over a guild's text channel, a group, or a private channel.

MessageId

An identifier for a Message

MessageReaction

A representation of a Reaction to a Message, where multiple of the same reaction type are stacked into one MessageReaction, with an associated count.

PartialGuild

Partial information about a guild. This does not include information like member data.

PermissionOverwrite

A channel-specific permission overwrite for a member or role.

Presence

A member's online status

PrivateChannel

A Direct Message text channel with another user.

Reaction

An Emoji reaction to a Message.

ReadState

Summary of messages since last login

Ready

An active group or private call. These are different from server voice channels.

Relationship

Information about a relationship that this user has with another user.

RichInvite

Detailed information about an invite. This information can only be retrieved by anyone with the Manage Guild permission. Otherwise, a minimal amount of information can be retrieved via the Invite struct.

Role

Information about a role within a guild. A role represents a set of permissions, and can be attached to one or multiple users. A role has various miscellaneous configurations, such as being assigned a colour. Roles are unique per guild and do not cross over to other guilds in any way, and can have channel-specific permission overrides in addition to guild-level permissions.

RoleId

An identifier for a Role

SuggestionReason

A reason that a User was suggested to be added as a friend.

Tutorial

The current user's progress through the Discord tutorial

User

Information about a user

UserConnection

A user's connection. Note: This is not in any way related to a WebSocket connection.

UserGuildSettings

Settings about a guild in regards to notification configuration

UserId

An identifier for a User

UserSettings

User settings usually used to influence client behavior

VoiceRegion

Information about an available voice region.

VoiceState

A member's state within a voice channel

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.

WebhookId

An identifier for a Webhook.

Enums

Channel

A container for any channel.

ChannelType

A representation of a type of channel.

ConnectionType

The type of a user Connection. Note: This is not in any way related to a WebSocket connection.

DefaultAvatar

An enum that represents a default avatar. The default avatar is calculated via the result of discriminator % 5.

Feature

A special feature, such as for VIP guilds, that a Guild has had granted to them.

GameType

The type of activity that is being performed when playing a Game.

GuildContainer

A container for guilds.

IncidentStatus

The type of status update during a service incident.

MessageType

Allows messages to be differentiated between regular ones and system ones like pins and clyde's responses.

NotificationLevel

Different level of notification levels such as mention-only, all messages, etc.

OnlineStatus

The representation of a user's status like online, idle, etc.

PermissionOverwriteType

The type of edit being made to a Channel's permissions.

PossibleGuild

A guild which may or may not currently be available.

ReactionType

The type of a Reaction sent.

Region

The name of a region that a guild's voice server can be located in.

RelationshipType
VerificationLevel

The level to set as criteria prior to a user being able to send messages in a Guild.

Traits

Mentionable

Allows something - such as a channel or role - to be mentioned in a message.