diff options
| author | Austin Hellyer <[email protected]> | 2016-11-26 13:16:42 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-26 13:16:42 -0800 |
| commit | 6328384eaff00cb1c8c91e95d5550c39d561bd1f (patch) | |
| tree | 9b50c0dd95be3104439e1fd6dc27fa7d20cafbc1 /examples | |
| parent | Add a bit more docs (diff) | |
| download | serenity-6328384eaff00cb1c8c91e95d5550c39d561bd1f.tar.xz serenity-6328384eaff00cb1c8c91e95d5550c39d561bd1f.zip | |
Voice example no longer requires 'extras'
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/07_voice.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/07_voice.rs b/examples/07_voice.rs index 5938c2f..377947e 100644 --- a/examples/07_voice.rs +++ b/examples/07_voice.rs @@ -9,12 +9,12 @@ use serenity::model::{ChannelId, Message}; #[cfg(feature = "voice")] use std::env; -#[cfg(any(not(feature = "extras"), not(feature = "voice")))] +#[cfg(not(feature = "voice"))] fn main() { panic!("'extras' and 'voice' must be enabled"); } -#[cfg(all(feature = "extras", feature = "voice"))] +#[cfg(feature = "voice")] fn main() { // Configure the client with your Discord bot token in the environment. let token = env::var("DISCORD_TOKEN") @@ -36,7 +36,7 @@ fn main() { let _ = client.start(); } -#[cfg(all(feature = "extras", feature = "voice"))] +#[cfg(feature = "voice")] fn deafen(context: Context, message: Message, _args: Vec<String>) { let guild_id = match CACHE.read().unwrap().get_guild_channel(message.channel_id) { Some(channel) => channel.guild_id, @@ -67,7 +67,7 @@ fn deafen(context: Context, message: Message, _args: Vec<String>) { } } -#[cfg(all(feature = "extras", feature = "voice"))] +#[cfg(feature = "voice")] fn join(context: Context, message: Message, args: Vec<String>) { let connect_to = match args.get(0) { Some(arg) => match arg.parse::<u64>() { @@ -102,7 +102,7 @@ fn join(context: Context, message: Message, args: Vec<String>) { let _ = context.say(&format!("Joined {}", connect_to.mention())); } -#[cfg(all(feature = "extras", feature = "voice"))] +#[cfg(feature = "voice")] fn leave(context: Context, message: Message, _args: Vec<String>) { let guild_id = match CACHE.read().unwrap().get_guild_channel(message.channel_id) { Some(channel) => channel.guild_id, @@ -127,7 +127,7 @@ fn leave(context: Context, message: Message, _args: Vec<String>) { } } -#[cfg(all(feature = "extras", feature = "voice"))] +#[cfg(feature = "voice")] fn mute(context: Context, message: Message, _args: Vec<String>) { let guild_id = match CACHE.read().unwrap().get_guild_channel(message.channel_id) { Some(channel) => channel.guild_id, |