diff --git a/src/bot/modal.rs b/src/bot/modal.rs index 5467812..4c0348d 100644 --- a/src/bot/modal.rs +++ b/src/bot/modal.rs @@ -1,6 +1,7 @@ use anyhow::Context as _; use serenity::all::{ Component, Context, CreateInteractionResponseMessage, Label, LabelComponent, ModalInteraction, + Permissions, }; use crate::{db, handler::Handler}; @@ -23,6 +24,16 @@ impl Handler { ctx: &Context, interaction: &ModalInteraction, ) -> anyhow::Result<()> { + if !interaction + .member + .as_ref() + .and_then(|x| x.permissions) + .map(|x| x.contains(Permissions::ADMINISTRATOR)) + .unwrap_or(false) + { + return Ok(()); + } + let Some(guild_id) = interaction.guild_id else { return Ok(()); };