aboutsummaryrefslogtreecommitdiff
path: root/examples/05_command_framework/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/05_command_framework/src')
-rw-r--r--examples/05_command_framework/src/main.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/05_command_framework/src/main.rs b/examples/05_command_framework/src/main.rs
index 437c44e..02a4f41 100644
--- a/examples/05_command_framework/src/main.rs
+++ b/examples/05_command_framework/src/main.rs
@@ -31,7 +31,7 @@ impl Key for CommandCounter {
struct Handler;
impl EventHandler for Handler {
- fn on_ready(&self, _: Context, ready: Ready) {
+ fn ready(&self, _: Context, ready: Ready) {
println!("{} is connected!", ready.user.name);
}
}
@@ -41,7 +41,7 @@ fn main() {
let token = env::var("DISCORD_TOKEN").expect(
"Expected a token in the environment",
);
- let mut client = Client::new(&token, Handler);
+ let mut client = Client::new(&token, Handler).expect("Err creating client");
{
let mut data = client.data.lock();
@@ -199,7 +199,7 @@ command!(about_role(_ctx, msg, args) {
if let Some(guild) = msg.guild() {
// `role_by_name()` allows us to attempt attaining a reference to a role
// via its name.
- if let Some(role) = guild.read().unwrap().role_by_name(&potential_role_name) {
+ if let Some(role) = guild.read().role_by_name(&potential_role_name) {
if let Err(why) = msg.channel_id.say(&format!("Role-ID: {}", role.id)) {
println!("Error sending message: {:?}", why);
}