From b2116ff9eec34031f830a3e0e02f8560e2071234 Mon Sep 17 00:00:00 2001 From: LinlyBoi Date: Sat, 6 Aug 2022 23:59:52 +0200 Subject: [PATCH] forgot we're not using a smart language --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 0fcd627..5172984 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,7 +15,7 @@ impl EventHandler for Handler { // Event handlers are dispatched through a threadpool, and so multiple // events can be dispatched simultaneously. async fn message(&self, ctx: Context, msg: Message) { - let mut phrase = String::new(); + let mut phrase = String::from("not pog"); if msg.content == "hello" { phrase = "http://nohello.com".to_string(); } @@ -27,9 +27,13 @@ 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 &phrase != "not pog" + { if let Err(why) = msg.channel_id.say(&ctx.http, &phrase).await { println!("Error sending message: {:?}", why); } + + } } // Set a handler to be called on the `ready` event. This is called when a