aboutsummaryrefslogtreecommitdiff
path: root/src/client/mod.rs
diff options
context:
space:
mode:
authorIllia <[email protected]>2016-12-10 22:25:55 +0200
committerzeyla <[email protected]>2016-12-10 12:25:55 -0800
commite44838f4339b90817b5eba5df16230b02487f0cc (patch)
tree8513ab3d9d3f9c8826f85630524cca1e4a7e188d /src/client/mod.rs
parentFix no-cache+method conditional compiles (diff)
downloadserenity-e44838f4339b90817b5eba5df16230b02487f0cc.tar.xz
serenity-e44838f4339b90817b5eba5df16230b02487f0cc.zip
More config for CreateCommand, add various methods
Adds multiple configurations to the command builder, and adds methods to various structs. Context::get_current_user is a shortcut to retrieve the current user from the cache. Message::get_member retrieves the member object of the message, if sent in a guild. Message::is_private checks if the message was sent in a Group or PrivateChannel. User::member retrieves the user's member object in a guild by Id; Adds 6 configurations to the command builder: - dm_only: whether the command can only be used in direct messages; - guild_only: whether the command can only be used in guilds; - help_available: whether the command should be displayed in the help list; - max_args: specify the maximum number of arguments a command must be given; - min_args: specify the minimum number of arguments a command must be given; - required_permissions: the permissions a member must have to be able to use the command;
Diffstat (limited to 'src/client/mod.rs')
-rw-r--r--src/client/mod.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/mod.rs b/src/client/mod.rs
index 843bbfe..c9a9c65 100644
--- a/src/client/mod.rs
+++ b/src/client/mod.rs
@@ -61,20 +61,20 @@ use ::model::event::{
};
use ::model::*;
-#[cfg(feature = "framework")]
+#[cfg(feature="framework")]
use ::ext::framework::Framework;
-#[cfg(feature = "cache")]
+#[cfg(feature="cache")]
use ::ext::cache::Cache;
-#[cfg(not(feature = "cache"))]
+#[cfg(not(feature="cache"))]
use ::model::event::{
CallUpdateEvent,
GuildMemberUpdateEvent,
UserSettingsUpdateEvent,
};
-#[cfg(feature = "cache")]
+#[cfg(feature="cache")]
lazy_static! {
/// A mutable and lazily-initialized static binding. It can be accessed
/// across any function and in any context.
@@ -841,7 +841,7 @@ impl Client {
}
}
-#[cfg(feature = "cache")]
+#[cfg(feature="cache")]
impl Client {
/// Attaches a handler for when a [`CallDelete`] is received.
///
@@ -1003,7 +1003,7 @@ impl Client {
}
}
-#[cfg(not(feature = "cache"))]
+#[cfg(not(feature="cache"))]
impl Client {
/// Attaches a handler for when a [`CallDelete`] is received.
///