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();
while let Some(interaction) = interaction_stream.next().await {
let action = &interaction.data.custom_id;
if action == "remove" {
msg.delete(&ctx).await.unwrap();
if interaction.user.id == msg.author.id {
let action = &interaction.data.custom_id;
if action == "remove" {
msg.delete(&ctx).await.unwrap();
}
reply.delete(&ctx).await.unwrap();
}
reply.delete(&ctx).await.unwrap();
}
}
}