Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Commit

Permalink
fix: make ignore_extra work for no param prefixed cmds (#582)
Browse files Browse the repository at this point in the history
  • Loading branch information
AstreaTSS authored Aug 2, 2022
1 parent 30e6955 commit c5e1bad
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions naff/models/naff/prefixed_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,8 @@ async def call_callback(self, callback: Callable, ctx: "PrefixedContext") -> Non
"""
# sourcery skip: remove-empty-nested-block, remove-redundant-if, remove-unnecessary-else
if len(self.parameters) == 0:
if ctx.args and not self.ignore_extra:
raise BadArgument(f"Too many arguments passed to {self.name}.")
return await self.call_with_binding(callback, ctx)
else:
# this is slightly costly, but probably worth it
Expand Down

0 comments on commit c5e1bad

Please sign in to comment.