Make permissions checking and notification separate functions

This commit is contained in:
2025-08-18 23:45:52 -03:00
parent 0af585cf9e
commit cddda58aca
6 changed files with 21 additions and 21 deletions
+1 -11
View File
@@ -20,17 +20,7 @@ pub struct ServerModeratorPermission;
#[async_trait]
impl Permission<State> for ServerModeratorPermission {
async fn check(&self, ctx: &CommandContext<State>) -> Result<bool, CommandError> {
let member = ctx
.rt
.http
.guild_member(ctx.event.guild_id.unwrap(), ctx.event.author.id)
.await
.map_err(CommandError::DiscordAPIFailed)?
.model()
.await
.map_err(CommandError::DiscordDeserializationFailed)?;
async fn check(&self, _ctx: &CommandContext<State>) -> Result<bool, CommandError> {
Ok(true)
}
}