It's possible! you can turn a 50-line code chunk into just 3 lines. Here's how
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user