From 395949805323ebcce284bb2ab6f443e2e3c61018 Mon Sep 17 00:00:00 2001 From: LinlyBoi Date: Sun, 7 Aug 2022 00:27:35 +0200 Subject: [PATCH] It's possible! you can turn a 50-line code chunk into just 3 lines. Here's how --- src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.rs b/src/main.rs index 5172984..88308d7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,6 +22,13 @@ impl EventHandler for Handler { else if msg.content == "help" { phrase = "https://dontasktoask.com/".to_string(); + } + else if msg.content == "!help" + { + let dm = msg.author.dm(&ctx, |m| m.content("I hate you")).await; + if let Err(why) = dm { + println!("Couldn't dm the noob: {:?}", why); + } } // Sending a message can fail, due to a network error, an // authentication error, or lack of permissions to post in the