Files
payphone/src/framework/commands/permissions.rs
T

15 lines
401 B
Rust

use std::fmt::Debug;
use async_trait::async_trait;
use crate::framework::commands::{CommandError, context::CommandContext};
#[async_trait]
pub trait Permission<S: Send + Sync + 'static>: Debug {
async fn check(&self, ctx: &CommandContext<S>) -> Result<bool, CommandError>;
async fn on_handle_denied(&self, _ctx: &CommandContext<S>) -> Result<(), CommandError> {
Ok(())
}
}