diff options
| author | Austin Hellyer <[email protected]> | 2016-11-13 19:28:13 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-14 18:32:10 -0800 |
| commit | 7d22fb2a9c70e5e517b359875a0157f72e352e43 (patch) | |
| tree | ca3bcb3a76f68960563d3c38d45e21f493ce32f8 /src/utils | |
| parent | Add internal module (diff) | |
| download | serenity-7d22fb2a9c70e5e517b359875a0157f72e352e43.tar.xz serenity-7d22fb2a9c70e5e517b359875a0157f72e352e43.zip | |
Add voice connection support
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/mod.rs | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/src/utils/mod.rs b/src/utils/mod.rs index dbd1455..28d18f1 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -1,4 +1,3 @@ - //! A set of utilities to help with common use cases that are not required to //! fully use the library. @@ -109,6 +108,56 @@ macro_rules! request { }}; } +// Enable/disable check for voice +macro_rules! feature_voice { + ($enabled:block) => { + { + feature_voice_enabled! {{ + $enabled + }} + } + }; + ($enabled:block $disabled:block) => { + { + feature_voice_enabled! {{ + $enabled + }} + + feature_voice_disabled! {{ + $disabled + }} + } + }; +} + +#[cfg(feature="voice")] +macro_rules! feature_voice_enabled { + ($enabled:block) => { + { + $enabled + } + } +} + +#[cfg(not(feature="voice"))] +macro_rules! feature_voice_enabled { + ($enabled:block) => {} +} + +#[cfg(feature="voice")] +macro_rules! feature_voice_disabled { + ($disabled:block) => {} +} + +#[cfg(not(feature="voice"))] +macro_rules! feature_voice_disabled { + ($disabled:block) => { + { + $disabled + } + } +} + /// Retrieves the "code" part of an [invite][`RichInvite`] out of a URL. /// /// # Examples |