Skip to content

Commit

Permalink
fix reversed condition
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbt365 committed Jun 16, 2024
1 parent 795c22d commit 76eb2a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion macros/src/command/prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub fn generate_prefix_action(inv: &Invocation) -> Result<proc_macro2::TokenStre
error,
))?;

let is_framework_cooldown = ctx.command.manual_cooldowns
let is_framework_cooldown = !ctx.command.manual_cooldowns
.unwrap_or_else(|| ctx.framework.options.manual_cooldowns);

if is_framework_cooldown {
Expand Down
6 changes: 3 additions & 3 deletions macros/src/command/slash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ pub fn generate_slash_action(inv: &Invocation) -> Result<proc_macro2::TokenStrea
#( (#param_names: #param_types), )*
).await.map_err(|error| error.to_framework_error(ctx))?;

let is_framework_cooldown = ctx.command.manual_cooldowns
let is_framework_cooldown = !ctx.command.manual_cooldowns
.unwrap_or_else(|| ctx.framework.options.manual_cooldowns);

if is_framework_cooldown {
Expand Down Expand Up @@ -218,9 +218,9 @@ pub fn generate_context_menu_action(
Ok(quote::quote! {
<#param_type as ::poise::ContextMenuParameter<_, _>>::to_action(|ctx, value| {
Box::pin(async move {
let is_framework_cooldown = ctx.command.manual_cooldowns
let is_framework_cooldown = !ctx.command.manual_cooldowns
.unwrap_or_else(|| ctx.framework.options.manual_cooldowns);

if is_framework_cooldown {
ctx.command.cooldowns.lock().unwrap().start_cooldown(ctx.cooldown_context());
}
Expand Down

0 comments on commit 76eb2a5

Please sign in to comment.