Add more words to the censored words list
This commit is contained in:
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
pub struct RedisCache {
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ use std::fmt::Debug;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use thiserror::Error;
|
||||
use twilight_http::response::DeserializeBodyError;
|
||||
|
||||
use crate::framework::commands::{
|
||||
arguments::Argument, context::CommandContext, permissions::Permission,
|
||||
@@ -26,6 +27,12 @@ pub enum CommandError {
|
||||
|
||||
#[error("The command was used in DMs, but it can only be used in servers")]
|
||||
ServerCommandRunInDMs,
|
||||
|
||||
#[error(transparent)]
|
||||
DiscordAPIFailed(#[from] twilight_http::Error),
|
||||
|
||||
#[error(transparent)]
|
||||
DiscordDeserializationFailed(#[from] DeserializeBodyError),
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
|
||||
@@ -158,6 +158,7 @@
|
||||
//! ```
|
||||
|
||||
pub mod bot;
|
||||
pub mod cache;
|
||||
pub mod commands;
|
||||
pub mod events;
|
||||
pub mod interactions;
|
||||
|
||||
@@ -85,4 +85,6 @@ faping
|
||||
masturbate
|
||||
masturbating
|
||||
masterbating
|
||||
masterbaiting
|
||||
masterbaiting
|
||||
horny
|
||||
hrny
|
||||
|
||||
@@ -5,3 +5,4 @@
|
||||
|
||||
pub mod commands;
|
||||
pub mod events;
|
||||
pub mod permissions;
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
use async_trait::async_trait;
|
||||
|
||||
use crate::{
|
||||
framework::commands::{CommandError, context::CommandContext, permissions::Permission},
|
||||
state::State,
|
||||
};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct GuildOnlyPermission;
|
||||
|
||||
#[async_trait]
|
||||
impl Permission<State> for GuildOnlyPermission {
|
||||
async fn check(&self, ctx: &CommandContext<State>) -> Result<bool, CommandError> {
|
||||
Ok(ctx.event.guild_id.is_none())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
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)?;
|
||||
|
||||
Ok(true)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user