From f6feb9135ee78bca8583f94d16de81d4ccc0112e Mon Sep 17 00:00:00 2001 From: acdenisSK Date: Wed, 1 Aug 2018 07:11:31 +0200 Subject: Reword the inner doc comment in `complex_bucket` --- src/framework/standard/mod.rs | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src/framework') 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 -- cgit v1.2.3