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,6 +141,7 @@ impl EventHandler for Handler {
.stream();
while let Some(interaction) = interaction_stream.next().await {
if interaction.user.id == msg.author.id {
let action = &interaction.data.custom_id;
if action == "remove" {
msg.delete(&ctx).await.unwrap();
@ -151,6 +152,7 @@ impl EventHandler for Handler {
}
}
}
}
#[tokio::main]
async fn main() {