1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! 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:
//!
//! ```rust,no_run
//! 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:
//!
//! ```rust,no_run
//! use serenity::model::prelude::*;
//! ```

#[macro_use]
mod utils;

pub mod application;
pub mod channel;
pub mod connection;
pub mod error;
pub mod event;
pub mod gateway;
pub mod guild;
pub mod id;
pub mod interactions;
pub mod invite;
pub mod mention;
pub mod misc;
pub mod oauth2;
pub mod permissions;
pub mod prelude;
pub mod sticker;
pub mod timestamp;
pub mod user;
pub mod voice;
pub mod webhook;

use std::collections::HashMap;
use std::result::Result as StdResult;

use serde::de::Visitor;
use serde::{Deserialize, Deserializer};
#[cfg(feature = "voice-model")]
pub use serenity_voice_model as voice_gateway;
pub use timestamp::Timestamp;

pub use self::error::Error as ModelError;
pub use self::permissions::Permissions;
use crate::internal::prelude::*;
#[cfg(feature = "utils")]
use crate::utils::Colour;