From 86975d8a767599e98c2269f2596229a5b6bc4eca Mon Sep 17 00:00:00 2001 From: GZod01 Date: Thu, 18 Apr 2024 12:20:23 +0200 Subject: [PATCH] helloo --- src/main.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 492fde7..aa44a3e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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]