Do not delete if interaction not done by original user

This commit is contained in:
Gabriel Simmer 2024-06-20 20:56:59 +01:00
parent 178ca616d1
commit 9efafd302a
Signed by: arch
SSH key fingerprint: SHA256:m3OEcdtrnBpMX+2BDGh/byv3hrCekCLzDYMdvGEKPPQ

View file

@ -141,11 +141,13 @@ impl EventHandler for Handler {
.stream(); .stream();
while let Some(interaction) = interaction_stream.next().await { while let Some(interaction) = interaction_stream.next().await {
let action = &interaction.data.custom_id; if interaction.user.id == msg.author.id {
if action == "remove" { let action = &interaction.data.custom_id;
msg.delete(&ctx).await.unwrap(); if action == "remove" {
msg.delete(&ctx).await.unwrap();
}
reply.delete(&ctx).await.unwrap();
} }
reply.delete(&ctx).await.unwrap();
} }
} }
} }