Run cargo fmt --all
This commit is contained in:
@@ -5,9 +5,13 @@ use deadpool_redis::{cluster::PoolError, redis::RedisError};
|
||||
use thiserror::Error;
|
||||
use twilight_http::response::DeserializeBodyError;
|
||||
|
||||
use crate::{database::models::{DatabaseError, DatabaseOrDiscordError}, framework::{commands::{
|
||||
arguments::Argument, context::CommandContext, permissions::Permission,
|
||||
}, runtime::Runtime}};
|
||||
use crate::{
|
||||
database::models::{DatabaseError, DatabaseOrDiscordError},
|
||||
framework::{
|
||||
commands::{arguments::Argument, context::CommandContext, permissions::Permission},
|
||||
runtime::Runtime,
|
||||
},
|
||||
};
|
||||
|
||||
pub mod arguments;
|
||||
pub mod context;
|
||||
@@ -40,7 +44,7 @@ pub enum CommandError {
|
||||
RedisFailed(#[from] RedisError),
|
||||
|
||||
#[error(transparent)]
|
||||
DatabaseOrDiscordError(#[from] DatabaseOrDiscordError)
|
||||
DatabaseOrDiscordError(#[from] DatabaseOrDiscordError),
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::framework::commands::{CommandError, context::CommandContext};
|
||||
#[async_trait]
|
||||
pub trait Permission<S: Send + Sync + 'static, E>: Debug {
|
||||
async fn check(&self, ctx: &CommandContext<S, E>) -> Result<bool, CommandError>;
|
||||
|
||||
|
||||
async fn on_handle_denied(&self, _ctx: &CommandContext<S, E>) -> Result<(), CommandError> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -81,9 +81,7 @@ where
|
||||
))
|
||||
.await
|
||||
.inspect(|_| log::debug!("Executed component interaction"))
|
||||
.inspect_err(|e| {
|
||||
log::error!("Interaction execution failed: {e:?}")
|
||||
})
|
||||
.inspect_err(|e| log::error!("Interaction execution failed: {e:?}"))
|
||||
} else {
|
||||
Err(InteractionError::InteractionNotFound)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user