Module model

Source
Expand description

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 model feature.

Normally you can import models through the sub-modules:

use serenity::model::channel::{ChannelType, GuildChannel, Message};
use serenity::model::id::{ChannelId, GuildId};
use serenity::model::user::User;

This can get a bit tedious - especially with a large number of imports - so this can be simplified by simply glob importing everything from the prelude:

use serenity::model::prelude::*;

Re-exports§

pub use self::colour::Color;
pub use self::colour::Colour;
pub use self::error::Error as ModelError;
pub use self::permissions::Permissions;
pub use self::timestamp::Timestamp;

Modules§

application
Models about OAuth2 applications.
channel
Models relating to channels and types within channels.
colour
connection
Models for user connections.
error
Error enum definition wrapping potential model implementation errors.
event
All the events this library handles.
gateway
Models pertaining to the gateway.
guild
Models relating to guilds and types that it owns.
id
A collection of newtypes defining type-strong IDs.
invite
Models for server and channel invites.
mention
misc
Miscellaneous helper traits, enums, and structs for models.
monetization
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.
prelude
The model prelude re-exports all types in the model sub-modules.
sticker
timestamp
Utilities for parsing and formatting RFC 3339 timestamps.
user
User information-related models.
voice
Representations of voice information.
webhook
Webhook model and implementations.