diff options
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/guild/feature.rs | 25 | ||||
| -rw-r--r-- | src/model/guild/mod.rs | 13 | ||||
| -rw-r--r-- | src/model/guild/partial_guild.rs | 7 |
3 files changed, 15 insertions, 30 deletions
diff --git a/src/model/guild/feature.rs b/src/model/guild/feature.rs deleted file mode 100644 index 40fd3fd..0000000 --- a/src/model/guild/feature.rs +++ /dev/null @@ -1,25 +0,0 @@ -/// A special feature, such as for VIP guilds, that a [`Guild`] has had granted -/// to them. -/// -/// [`Guild`]: struct.Guild.html -#[derive(Copy, Clone, Debug, Deserialize, Hash, Eq, PartialEq)] -pub enum Feature { - /// The [`Guild`] can set a custom [`splash`][`Guild::splash`] image on - /// invite URLs. - /// - /// [`Guild`]: struct.Guild.html - /// [`Guild::splash`]: struct.Guild.html#structfield.splash - #[serde(rename = "INVITE_SPLASH")] - InviteSplash, - /// The [`Guild`] can set a Vanity URL, which is a custom-named permanent - /// invite code. - /// - /// [`Guild`]: struct.Guild.html - #[serde(rename = "VANITY_URL")] - VanityUrl, - /// The [`Guild`] has access to VIP voice channel regions. - /// - /// [`Guild`]: struct.Guild.html - #[serde(rename = "VIP_REGIONS")] - VipRegions, -} diff --git a/src/model/guild/mod.rs b/src/model/guild/mod.rs index 110ef4e..3615e5d 100644 --- a/src/model/guild/mod.rs +++ b/src/model/guild/mod.rs @@ -1,5 +1,4 @@ mod emoji; -mod feature; mod guild_id; mod integration; mod member; @@ -8,7 +7,6 @@ mod role; mod audit_log; pub use self::emoji::*; -pub use self::feature::*; pub use self::guild_id::*; pub use self::integration::*; pub use self::member::*; @@ -62,8 +60,15 @@ pub struct Guild { /// VIP features enabled for the guild. Can be obtained through the /// [Discord Partnership] website. /// + /// The following is a list of known features: + /// + /// - `INVITE_SPLASH` + /// - `VANITY_URL` + /// - `VERIFIED` + /// - `VIP_REGIONS` + /// /// [Discord Partnership]: https://discordapp.com/partners - pub features: Vec<Feature>, + pub features: Vec<String>, /// The hash of the icon used by the guild. /// /// In the client, this appears on the guild list on the left-hand side. @@ -1351,7 +1356,7 @@ impl<'de> Deserialize<'de> for Guild { .map_err(DeError::custom)?; let features = map.remove("features") .ok_or_else(|| DeError::custom("expected guild features")) - .and_then(serde_json::from_value::<Vec<Feature>>) + .and_then(serde_json::from_value::<Vec<String>>) .map_err(DeError::custom)?; let icon = match map.remove("icon") { Some(v) => Option::<String>::deserialize(v).map_err(DeError::custom)?, diff --git a/src/model/guild/partial_guild.rs b/src/model/guild/partial_guild.rs index cb2f8ef..6a8717d 100644 --- a/src/model/guild/partial_guild.rs +++ b/src/model/guild/partial_guild.rs @@ -17,7 +17,12 @@ pub struct PartialGuild { pub embed_channel_id: Option<ChannelId>, pub embed_enabled: bool, #[serde(deserialize_with = "deserialize_emojis")] pub emojis: HashMap<EmojiId, Emoji>, - pub features: Vec<Feature>, + /// Features enabled for the guild. + /// + /// Refer to [`Guild::features`] for more information. + /// + /// [`Guild::features`]: struct.Guild.html#structfield.features + pub features: Vec<String>, pub icon: Option<String>, pub mfa_level: u64, pub name: String, |