diff options
| author | Zeyla Hellyer <[email protected]> | 2017-02-15 09:27:39 -0800 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-02-15 09:27:39 -0800 |
| commit | 1787e00eab126680932076e24ac820cad0bfc383 (patch) | |
| tree | 54aab4f5dc5a1f211a76af4272d1b983cc049a84 /src/ext/cache | |
| parent | Update README for `methods` feature removal (diff) | |
| download | serenity-1787e00eab126680932076e24ac820cad0bfc383.tar.xz serenity-1787e00eab126680932076e24ac820cad0bfc383.zip | |
Update doctests for Context changes
Due to the Context having many methods removed, the doctests were
failing.
Update the doctests to use alternative methods to accomplish the same.
Example:
Before:
```rust
context.say("hi");
```
After:
```rust
message.channel_id.say("hi")
```
Diffstat (limited to 'src/ext/cache')
| -rw-r--r-- | src/ext/cache/mod.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/ext/cache/mod.rs b/src/ext/cache/mod.rs index 064add0..b39f5ea 100644 --- a/src/ext/cache/mod.rs +++ b/src/ext/cache/mod.rs @@ -368,7 +368,7 @@ impl Cache { /// let channel = match cache.get_guild_channel(message.channel_id) { /// Some(channel) => channel, /// None => { - /// if let Err(why) = context.say("Could not find guild's channel data") { + /// if let Err(why) = message.channel_id.say("Could not find guild's channel data") { /// println!("Error sending message: {:?}", why); /// } /// @@ -414,14 +414,12 @@ impl Cache { /// ```rust,ignore /// use serenity::client::CACHE; /// - /// // assuming you are in a context - /// /// let cache = CACHE.read().unwrap(); /// let member = { /// let channel = match cache.get_guild_channel(message.channel_id) { /// Some(channel) => channel, /// None => { - /// if let Err(why) = context.say("Error finding channel data") { + /// if let Err(why) = message.channel_id.say("Error finding channel data") { /// println!("Error sending message: {:?}", why); /// } /// }, @@ -430,7 +428,7 @@ impl Cache { /// match cache.get_member(channel.guild_id, message.author.id) { /// Some(member) => member, /// None => { - /// if let Err(why) = context.say("Error finding member data") { + /// if let Err(why) = message.channel_id.say("Error finding member data") { /// println!("Error sending message: {:?}", why); /// } /// }, @@ -439,7 +437,7 @@ impl Cache { /// /// let msg = format!("You have {} roles", member.roles.len()); /// - /// if let Err(why) = context.say(&msg) { + /// if let Err(why) = message.channel_id.say(&msg) { /// println!("Error sending message: {:?}", why); /// } /// ``` |