diff options
Diffstat (limited to 'src/commands/mod.rs')
-rw-r--r-- | src/commands/mod.rs | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/commands/mod.rs b/src/commands/mod.rs index d793c95..f51a3e2 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -39,21 +39,13 @@ pub async fn handle_interaction( } }, 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(()) - } + if component.data.custom_id.starts_with("discocaml-") { + discocaml::handle_button(ctx, &config.discocaml, db, component) + .await + .context("failed to handle discocaml command") + } else { + log::warn!("unexpected interaction: {:#?}", interaction); + Ok(()) } } |