Skip to content

Commit 0e3f013

Browse files
committed
Fixed some bugs
1 parent a04f630 commit 0e3f013

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

dico_command/bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def wrap(func):
8181
return wrap
8282

8383
def handle_command_error(self, context, ex):
84-
if not self.events.get("command_error"):
84+
if not self.events.get("COMMAND_ERROR"):
8585
self.logger.error(f"Error while executing command '{context.command.name}':\n"+''.join(traceback.format_exception(type(ex), ex, ex.__traceback__)))
8686
else:
8787
self.dispatch("command_error", context, ex)

dico_command/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ def smart_split(ipt: str, args_data: dict, splitter: str = " ") -> typing.Tuple[
3535
if len(args_data) == 1:
3636
if last_arg["kind"] == last_arg["kind"].VAR_POSITIONAL:
3737
return [ipt], {}
38+
elif last_arg["kind"] == last_arg["kind"].KEYWORD_ONLY:
39+
return [], {args_name[-1]: ipt}
3840
else:
3941
return [initial_split[0]], {}
4042
if (len(initial_split) == len(args_data) and not keyword_only_count) or last_arg["kind"] == last_arg["kind"].VAR_POSITIONAL: # assuming this matches

0 commit comments

Comments
 (0)