@@ -429,12 +429,6 @@ async def set_guild_settings(
429
429
command_type = "Toggled" if config_type == ConfigType .TOGGLE else "Set"
430
430
await ctx .send (f"{ command_type } `{ key } ` from `{ original_value } ` to `{ value } `" )
431
431
432
- async def _handle_config_error (
433
- self , error : commands .CommandError , ctx : GuildContext
434
- ) -> None :
435
- if isinstance (error , commands .BadArgument ):
436
- await ctx .send (str (error ))
437
-
438
432
### Blocklist utilities
439
433
440
434
async def can_be_blocked (self , ctx : GuildContext , entity : discord .Member ) -> bool :
@@ -470,11 +464,13 @@ def clean_prefixes(self, prefixes: Union[str, list[str]]) -> str:
470
464
471
465
### Misc Utilities
472
466
async def _handle_error (
473
- self , ctx : GuildContext , error : commands .CommandError
467
+ self , error : commands .CommandError , * , ctx : GuildContext
474
468
) -> None :
475
469
if isinstance (error , commands .CommandOnCooldown ):
476
470
embed = CooldownEmbed (error .retry_after )
477
471
await ctx .send (embed = embed )
472
+ elif isinstance (error , commands .BadArgument ):
473
+ await ctx .send (str (error ))
478
474
479
475
@check_permissions (manage_guild = True )
480
476
@bot_check_permissions (manage_channels = True , manage_webhooks = True )
@@ -707,13 +703,13 @@ async def delete(self, ctx: GuildContext) -> None:
707
703
async def on_setup_error (
708
704
self , ctx : GuildContext , error : commands .CommandError
709
705
) -> None :
710
- await self ._handle_error (ctx , error )
706
+ await self ._handle_error (error , ctx = ctx )
711
707
712
708
@delete .error
713
709
async def on_delete_error (
714
710
self , ctx : GuildContext , error : commands .CommandError
715
711
) -> None :
716
- await self ._handle_error (ctx , error )
712
+ await self ._handle_error (error , ctx = ctx )
717
713
718
714
@check_permissions (manage_guild = True )
719
715
@commands .guild_only ()
@@ -836,19 +832,19 @@ async def config_toggle(
836
832
async def on_config_set_age_error (
837
833
self , ctx : GuildContext , error : commands .CommandError
838
834
):
839
- await self ._handle_config_error (error , ctx )
835
+ await self ._handle_error (error , ctx = ctx )
840
836
841
837
@config_set .error
842
838
async def on_config_set_error (
843
839
self , ctx : GuildContext , error : commands .CommandError
844
840
):
845
- await self ._handle_config_error (error , ctx )
841
+ await self ._handle_error (error , ctx = ctx )
846
842
847
843
@config_toggle .error
848
844
async def on_config_toggle_error (
849
845
self , ctx : GuildContext , error : commands .CommandError
850
846
):
851
- await self ._handle_config_error (error , ctx )
847
+ await self ._handle_error (error , ctx = ctx )
852
848
853
849
@check_permissions (manage_guild = True )
854
850
@commands .guild_only ()
0 commit comments