mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 01:00:49 +00:00
osu: Always load Me
as a follow-up response
This commit is contained in:
parent
76fd6c803d
commit
24e476239c
3 changed files with 73 additions and 75 deletions
|
@ -26,13 +26,13 @@ where
|
|||
/// InteractionHook represents the asynchronous hook that is run on every interaction.
|
||||
#[async_trait]
|
||||
pub trait InteractionHook: Send + Sync {
|
||||
async fn call(&mut self, ctx: &Context, interaction: &Interaction) -> Result<()>;
|
||||
async fn call(&self, ctx: &Context, interaction: &Interaction) -> Result<()>;
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<T> InteractionHook for T
|
||||
where
|
||||
T: for<'a> FnMut(
|
||||
T: for<'a> Fn(
|
||||
&'a Context,
|
||||
&'a Interaction,
|
||||
)
|
||||
|
@ -40,7 +40,7 @@ where
|
|||
+ Send
|
||||
+ Sync,
|
||||
{
|
||||
async fn call(&mut self, ctx: &Context, interaction: &Interaction) -> Result<()> {
|
||||
async fn call(&self, ctx: &Context, interaction: &Interaction) -> Result<()> {
|
||||
self(ctx, interaction).await
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue