It's possible! you can turn a 50-line code chunk into just 3 lines. Here's how

This commit is contained in:
LinlyBoi
2022-08-07 00:27:35 +02:00
parent b2116ff9ee
commit 3959498053

View File

@@ -22,6 +22,13 @@ impl EventHandler for Handler {
else if msg.content == "help" else if msg.content == "help"
{ {
phrase = "https://dontasktoask.com/".to_string(); 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 // Sending a message can fail, due to a network error, an
// authentication error, or lack of permissions to post in the // authentication error, or lack of permissions to post in the