aboutsummaryrefslogtreecommitdiff
path: root/src/ext/framework/help_commands.rs
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-02-12 16:30:47 -0800
committerZeyla Hellyer <[email protected]>2017-02-12 16:30:47 -0800
commit585af231028e46788d689f94e14e110c072a578e (patch)
tree0afa6508ddd11f90d952edd4ce5876f5102c1604 /src/ext/framework/help_commands.rs
parentRe-export hyper status enums in rest module (diff)
downloadserenity-585af231028e46788d689f94e14e110c072a578e.tar.xz
serenity-585af231028e46788d689f94e14e110c072a578e.zip
Remove most Context methods
Most of the methods in the Context were for interacting with the related ChannelId, but these methods have been re-implemented on ChannelId itself, and is now the preferred (and now only) way to interact with it.
Diffstat (limited to 'src/ext/framework/help_commands.rs')
-rw-r--r--src/ext/framework/help_commands.rs18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/ext/framework/help_commands.rs b/src/ext/framework/help_commands.rs
index 863f3fd..d5e6ae2 100644
--- a/src/ext/framework/help_commands.rs
+++ b/src/ext/framework/help_commands.rs
@@ -8,7 +8,9 @@ use ::model::Message;
use ::utils::Colour;
fn error_embed(ctx: &mut Context, input: &str) {
- let _ = ctx.send_message(|m| m
+ let _ = ctx.channel_id
+ .unwrap()
+ .send_message(|m| m
.embed(|e| e
.colour(Colour::dark_red())
.description(input)));
@@ -63,7 +65,7 @@ pub fn with_embeds(ctx: &mut Context,
return Ok(());
}
- let _ = ctx.send_message(|m| {
+ let _ = ctx.channel_id.unwrap().send_message(|m| {
m.embed(|e| {
let mut embed = e.colour(Colour::rosewater())
.title(command_name);
@@ -115,7 +117,7 @@ pub fn with_embeds(ctx: &mut Context,
return Ok(());
}
- let _ = ctx.send_message(|m| m
+ let _ = ctx.channel_id.unwrap().send_message(|m| m
.embed(|mut e| {
e = e.colour(Colour::rosewater())
.description("To get help with an individual command, pass its \
@@ -174,7 +176,7 @@ pub fn plain(ctx: &mut Context,
found = Some((command_name, cmd));
},
CommandOrAlias::Alias(ref name) => {
- let _ = ctx.say(&format!("Did you mean {:?}?", name));
+ let _ = ctx.channel_id.unwrap().say(&format!("Did you mean {:?}?", name));
return Ok(());
}
}
@@ -183,7 +185,7 @@ pub fn plain(ctx: &mut Context,
if let Some((command_name, command)) = found {
if !command.help_available {
- let _ = ctx.say("**Error**: No help available.");
+ let _ = ctx.channel_id.unwrap().say("**Error**: No help available.");
return Ok(());
}
@@ -215,13 +217,13 @@ pub fn plain(ctx: &mut Context,
});
result.push_str("\n");
- let _ = ctx.say(&result);
+ let _ = ctx.channel_id.unwrap().say(&result);
return Ok(());
}
}
- let _ = ctx.say(&format!("**Error**: Command `{}` not found.", name));
+ let _ = ctx.channel_id.unwrap().say(&format!("**Error**: Command `{}` not found.", name));
return Ok(());
}
@@ -254,7 +256,7 @@ pub fn plain(ctx: &mut Context,
result.push('\n');
}
- let _ = ctx.say(&result);
+ let _ = ctx.channel_id.unwrap().say(&result);
Ok(())
}