aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2016-11-09 20:37:22 -0800
committerAustin Hellyer <[email protected]>2016-11-09 20:37:22 -0800
commitab1bc3fe821c9b66d4e348bf10ce3a096195bdba (patch)
treebca39ceedc4cb4380d79bb286ae89fe9a7f354e5 /src
parentCorrectly decode Group channel IDs (diff)
downloadserenity-ab1bc3fe821c9b66d4e348bf10ce3a096195bdba.tar.xz
serenity-ab1bc3fe821c9b66d4e348bf10ce3a096195bdba.zip
Add a Feature enum
Features are handed by Discord to guilds that meet requirements which are most likely realistically arbitrary. The 3 features at this moment are: - INVITE_SPLASH - VANITY_URL - VIP_REGIONS On decoding of the two guild structs, map these string values to enum variants.
Diffstat (limited to 'src')
-rw-r--r--src/model/guild.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/model/guild.rs b/src/model/guild.rs
index e8aff56..460f5ca 100644
--- a/src/model/guild.rs
+++ b/src/model/guild.rs
@@ -309,7 +309,7 @@ impl LiveGuild {
channels: public_channels,
default_message_notifications: req!(try!(remove(&mut map, "default_message_notifications")).as_u64()),
emojis: try!(remove(&mut map, "emojis").and_then(decode_emojis)),
- features: try!(remove(&mut map, "features").and_then(|v| decode_array(v, into_string))),
+ features: try!(remove(&mut map, "features").and_then(|v| decode_array(v, Feature::decode_str))),
icon: try!(opt(&mut map, "icon", into_string)),
id: id,
joined_at: try!(remove(&mut map, "joined_at").and_then(into_string)),