diff options
| author | acdenisSK <[email protected]> | 2017-11-16 16:59:05 +0100 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2017-11-16 16:59:05 +0100 |
| commit | d930758c09cf3f7d56a50f941a6b526dee288e9b (patch) | |
| tree | dff088597c58860f999c4a3f7eb82cc5cb3dba1b /src/framework/standard/mod.rs | |
| parent | Document that application owners bypass checks (#218) (diff) | |
| download | serenity-d930758c09cf3f7d56a50f941a6b526dee288e9b.tar.xz serenity-d930758c09cf3f7d56a50f941a6b526dee288e9b.zip | |
Fix doc-tests
Diffstat (limited to 'src/framework/standard/mod.rs')
| -rw-r--r-- | src/framework/standard/mod.rs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/framework/standard/mod.rs b/src/framework/standard/mod.rs index 106d64c..4148827 100644 --- a/src/framework/standard/mod.rs +++ b/src/framework/standard/mod.rs @@ -283,7 +283,11 @@ impl StandardFramework { /// .bucket("basic", 2, 10, 3) /// .command("ping", |c| c /// .bucket("basic") - /// .exec_str("pong!"))); + /// .exec(|_, msg, _| { + /// msg.channel_id.say("pong!")?; + /// + /// Ok(()) + /// }))); /// ``` pub fn bucket(mut self, s: &str, delay: i64, time_span: i64, limit: i32) -> Self { self.buckets.insert( @@ -325,7 +329,11 @@ impl StandardFramework { /// }) /// .command("ping", |c| c /// .bucket("basic") - /// .exec_str("pong!"))); + /// .exec(|_, msg, _| { + /// msg.channel_id.say("pong!")?; + /// + /// Ok(()) + /// }))); /// ``` /// /// [`bucket`]: #method.bucket @@ -425,7 +433,7 @@ impl StandardFramework { /// .simple_bucket("simple", 2) /// .command("ping", |c| c /// .bucket("simple") - /// .exec_str("pong!"))); + /// .exec(|_, msg, _| { msg.channel_id.say("pong!")?; Ok(()) }))); /// ``` pub fn simple_bucket<S>(mut self, s: &str, delay: i64) -> Self { self.buckets.insert( @@ -616,7 +624,7 @@ impl StandardFramework { /// # /// use serenity::framework::StandardFramework; /// - /// client.with_framework(StandardFramework::new().on("ping", ping)); + /// client.with_framework(StandardFramework::new().cmd("ping", ping)); /// /// command!(ping(_ctx, msg) { /// let _ = msg.channel_id.say("pong!"); @@ -739,8 +747,8 @@ impl StandardFramework { /// /// client.with_framework(StandardFramework::new() /// .group("ping-pong", |g| g - /// .command("ping", |c| c.exec_str("pong!")) - /// .command("pong", |c| c.exec_str("ping!")))); + /// .on("ping", |_, msg, _| { msg.channel_id.say("pong!")?; Ok(()) }) + /// .on("pong", |_, msg, _| { msg.channel_id.say("ping!")?; Ok(()) }))); /// ``` pub fn group<F, S>(mut self, group_name: S, f: F) -> Self where F: FnOnce(CreateGroup) -> CreateGroup, S: Into<String> { |