This commit is contained in:
Gzod01 2024-04-18 12:20:23 +02:00
parent 9622c3d0bc
commit 86975d8a76

View file

@ -1,5 +1,6 @@
use std::env;
use serenity::all::{ComponentInteractionData, ComponentInteractionDataKind, Interaction};
use serenity::async_trait;
use serenity::model::channel::Message;
use serenity::prelude::*;
@ -29,9 +30,16 @@ impl EventHandler for Handler {
}
}
}
// async fn interaction_create(&self, ctx: Context, interaction: Interaction){
// }
async fn interaction_create(&self, ctx: Context, interaction: Interaction){
if let Interaction::Component(comp) = interaction{
println!("Received component interaction {comp:?}");
if matches!(comp.data.kind, ComponentInteractionDataKind::Button){
let compid = comp.data.custom_id;
println!("helloworld {compid:?}");
}
}
}
}
#[tokio::main]