aboutsummaryrefslogtreecommitdiff
path: root/src/framework
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2018-08-01 07:11:31 +0200
committeracdenisSK <[email protected]>2018-08-01 07:14:05 +0200
commit02de7789d72141434264e8bd7cee7e1fc65a043f (patch)
tree1a14b8e22159cffd4060a80241fa87ebb64ad274 /src/framework
parentMerge deserialization tests into one (diff)
downloadserenity-02de7789d72141434264e8bd7cee7e1fc65a043f.tar.xz
serenity-02de7789d72141434264e8bd7cee7e1fc65a043f.zip
Reword the inner doc comment in `complex_bucket`
Diffstat (limited to 'src/framework')
-rw-r--r--src/framework/standard/mod.rs26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/framework/standard/mod.rs b/src/framework/standard/mod.rs
index 1fa9a13..0bb0309 100644
--- a/src/framework/standard/mod.rs
+++ b/src/framework/standard/mod.rs
@@ -325,12 +325,10 @@ impl StandardFramework {
///
/// client.with_framework(StandardFramework::new()
/// .complex_bucket("basic", 2, 10, 3, |_, guild_id, channel_id, user_id| {
- /// // check if the guild is `123` and the channel where the command(s) was called:
- /// // `456`
- /// // and if the user who called the command(s) is `789`
- /// // otherwise don't apply the bucket at all.
- /// guild_id.is_some() && guild_id.unwrap() == 123 && channel_id == 456
- /// && user_id == 789
+ /// // Our bucket is very strict. It cannot apply in DMs.
+ /// // And can only apply if it's in the specific guild, channel and by the specific user.
+ /// guild_id.is_some() && guild_id.unwrap() == 123 && channel_id == 456
+ /// && user_id == 789
/// })
/// .command("ping", |c| c
/// .bucket("basic")
@@ -338,7 +336,9 @@ impl StandardFramework {
/// msg.channel_id.say("pong!")?;
///
/// Ok(())
- /// })));
+ /// })
+ /// )
+ /// );
/// ```
///
/// [`bucket`]: #method.bucket
@@ -384,14 +384,18 @@ impl StandardFramework {
///
/// client.with_framework(StandardFramework::new()
/// .complex_bucket("basic", 2, 10, 3, |_, channel_id, user_id| {
- /// // check if the channel's id where the command(s) was called is `456`
- /// // and if the user who called the command(s) is `789`
- /// // otherwise don't apply the bucket at all.
+ /// Our bucket is somewhat strict. It can only apply in the specific channel and by the specific user.
/// channel_id == 456 && user_id == 789
/// })
/// .command("ping", |c| c
/// .bucket("basic")
- /// .exec_str("pong!")));
+ /// .exec(|_, msg, _| {
+ /// msg.channel_id.say("pong!")?;
+ ///
+ /// Ok(())
+ /// })
+ /// )
+ /// );
/// ```
///
/// [`bucket`]: #method.bucket