diff options
Diffstat (limited to 'src/commands/mod.rs')
-rw-r--r-- | src/commands/mod.rs | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 899bb8f..d793c95 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -34,13 +34,31 @@ pub async fn handle_interaction( .await .context("failed to handle discocaml command"), _ => { - log::warn!("unexpected interaction: {:?}", interaction); + log::warn!("unexpected interaction: {:#?}", interaction); Ok(()) } }, + Interaction::Component(component) => { + match component + .message + .interaction + .as_ref() + .map(|i| &i.name as &str) + { + Some("discocaml") => { + discocaml::handle_button(ctx, &config.discocaml, db, component) + .await + .context("failed to handle discocaml command") + } + _ => { + log::warn!("unexpected interaction: {:#?}", interaction); + Ok(()) + } + } + } _ => { - log::warn!("unexpected interaction: {:?}", interaction); + log::warn!("unexpected interaction: {:#?}", interaction); Ok(()) } } |