forgot we're not using a smart language

This commit is contained in:
LinlyBoi
2022-08-06 23:59:52 +02:00
parent df0e01f05e
commit b2116ff9ee

View File

@@ -15,7 +15,7 @@ impl EventHandler for Handler {
// Event handlers are dispatched through a threadpool, and so multiple // Event handlers are dispatched through a threadpool, and so multiple
// events can be dispatched simultaneously. // events can be dispatched simultaneously.
async fn message(&self, ctx: Context, msg: Message) { async fn message(&self, ctx: Context, msg: Message) {
let mut phrase = String::new(); let mut phrase = String::from("not pog");
if msg.content == "hello" { if msg.content == "hello" {
phrase = "http://nohello.com".to_string(); phrase = "http://nohello.com".to_string();
} }
@@ -27,9 +27,13 @@ impl EventHandler for Handler {
// authentication error, or lack of permissions to post in the // authentication error, or lack of permissions to post in the
// channel, so log to stdout when some error happens, with a // channel, so log to stdout when some error happens, with a
// description of it. // description of it.
if &phrase != "not pog"
{
if let Err(why) = msg.channel_id.say(&ctx.http, &phrase).await { if let Err(why) = msg.channel_id.say(&ctx.http, &phrase).await {
println!("Error sending message: {:?}", why); println!("Error sending message: {:?}", why);
} }
}
} }
// Set a handler to be called on the `ready` event. This is called when a // Set a handler to be called on the `ready` event. This is called when a