From 0d66c185a5e6a38e43efc921b1244f58d84db81a Mon Sep 17 00:00:00 2001 From: LinlyBoi Date: Sat, 6 Aug 2022 23:18:48 +0200 Subject: [PATCH] god help us all --- src/main.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 38c1d60..9e4340a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,7 +20,18 @@ impl EventHandler for Handler { // authentication error, or lack of permissions to post in the // channel, so log to stdout when some error happens, with a // description of it. - if let Err(why) = msg.channel_id.say(&ctx.http, "Pong!").await { + if let Err(why) = msg.channel_id.say(&ctx.http, "Pong!").await + { + println!("Error sending message: {:?}", why); + } + } + else if msg.content == "hello" { + // Sending a message can fail, due to a network error, an + // authentication error, or lack of permissions to post in the + // channel, so log to stdout when some error happens, with a + // description of it. + if let Err(why) = msg.channel_id.say(&ctx.http, "https://www.nohello.com/".await + { println!("Error sending message: {:?}", why); } }