aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2016-11-13 19:28:13 -0800
committerAustin Hellyer <[email protected]>2016-11-14 18:32:10 -0800
commit7d22fb2a9c70e5e517b359875a0157f72e352e43 (patch)
treeca3bcb3a76f68960563d3c38d45e21f493ce32f8 /src/utils
parentAdd internal module (diff)
downloadserenity-7d22fb2a9c70e5e517b359875a0157f72e352e43.tar.xz
serenity-7d22fb2a9c70e5e517b359875a0157f72e352e43.zip
Add voice connection support
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/mod.rs51
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