Prevent banned users from using call commands
This commit is contained in:
@@ -5,8 +5,10 @@ use twilight_model::id::Id;
|
||||
use crate::{
|
||||
database::models::{Call, Channel},
|
||||
discord::sanitizing::SanitizeDiscordMarkdown,
|
||||
framework::commands::{Command, CommandError, context::CommandContext},
|
||||
groups::calls::get_display_profile,
|
||||
framework::commands::{
|
||||
Command, CommandError, context::CommandContext, permissions::Permission,
|
||||
},
|
||||
groups::calls::{get_display_profile, permissions::NotBannedPermission},
|
||||
state::State,
|
||||
utils::Bye,
|
||||
};
|
||||
@@ -38,6 +40,10 @@ impl Command<State> for CallCommand {
|
||||
&["c"]
|
||||
}
|
||||
|
||||
fn permissions(&self) -> Vec<Box<dyn Permission<State> + Send + Sync + 'static>> {
|
||||
vec![Box::new(NotBannedPermission)]
|
||||
}
|
||||
|
||||
async fn execute(
|
||||
&self,
|
||||
ctx: CommandContext<'_, State>,
|
||||
@@ -124,6 +130,10 @@ impl Command<State> for SkipCommand {
|
||||
&["s", "next"]
|
||||
}
|
||||
|
||||
fn permissions(&self) -> Vec<Box<dyn Permission<State> + Send + Sync + 'static>> {
|
||||
vec![Box::new(NotBannedPermission)]
|
||||
}
|
||||
|
||||
async fn execute(
|
||||
&self,
|
||||
ctx: CommandContext<'_, State>,
|
||||
@@ -226,6 +236,10 @@ impl Command<State> for HangupCommand {
|
||||
&["h", "hang"]
|
||||
}
|
||||
|
||||
fn permissions(&self) -> Vec<Box<dyn Permission<State> + Send + Sync + 'static>> {
|
||||
vec![Box::new(NotBannedPermission)]
|
||||
}
|
||||
|
||||
async fn execute(
|
||||
&self,
|
||||
ctx: CommandContext<'_, State>,
|
||||
@@ -324,6 +338,10 @@ impl Command<State> for FriendRequestCommand {
|
||||
"Shows your username to the other party and asks them to send you a friend request on Discord."
|
||||
}
|
||||
|
||||
fn permissions(&self) -> Vec<Box<dyn Permission<State> + Send + Sync + 'static>> {
|
||||
vec![Box::new(NotBannedPermission)]
|
||||
}
|
||||
|
||||
async fn execute(
|
||||
&self,
|
||||
ctx: CommandContext<'_, State>,
|
||||
|
||||
Reference in New Issue
Block a user