diff --git a/src/commands/sm_server.rs b/src/commands/sm_server.rs index 6a47a75..67bad3c 100644 --- a/src/commands/sm_server.rs +++ b/src/commands/sm_server.rs @@ -103,14 +103,17 @@ pub async fn handle_reaction_add(ctx: Context, reaction: Reaction) { if reaction.emoji.unicode_eq("👍") { - utils::add_role(ctx, reaction.user_id.expect("UserId was None in handle_reaction_add"), + let user_name = reaction.user(ctx.clone()).await.unwrap().name; + utils::add_role(ctx.clone(), reaction.user_id.expect("UserId was None in handle_reaction_add"), RoleId::from(ROLE_ID_ANY_PERCENT), reaction.guild_id.expect("GuildId was None in handle_reaction_add")) .await.unwrap(); + + utils::Logger::log_message(ctx.clone(), &format!("Added any% role for {}", user_name)).await; } else { - utils::Logger::log_message(ctx, "Reaction was not the thumbs up emoji").await; + utils::Logger::log_message(ctx.clone(), "Reaction was not the thumbs up emoji").await; } } } diff --git a/src/main.rs b/src/main.rs index c3f8af5..3176ffc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -46,7 +46,7 @@ impl EventHandler for Handler async fn reaction_add(&self, ctx: Context, add_reaction: Reaction) { - // println!("reaction_add event"); + println!("reaction_add event"); //utils::Logger::log_message(ctx, &format!("reaction add event: {:#?}", add_reaction)).await; // todo!() @@ -56,7 +56,7 @@ impl EventHandler for Handler async fn reaction_remove(&self, ctx: Context, removed_reaction: Reaction) { println!("reaction_remove event"); - utils::Logger::log_message(ctx, &format!("reaction removed event: {:#?}", removed_reaction)).await; + //utils::Logger::log_message(ctx, &format!("reaction removed event: {:#?}", removed_reaction)).await; } // Set a handler to be called on the `ready` event. This is called when a