Skip to content

Command handler method raises exception when command has an argument #1

@toracle

Description

@toracle

bothub sdk supports command handler with on_{command} named method.

When command has an argument, Bot.on_command(self, event, context) raises an exception because it's called with command arguments. It should be Bot.on_command(self, event, context, arg1, arg2, ...). But it's easy to make a mistake to omit following arg1, arg2, ... argument.

User would avoid an exception when declare method like this for quick-and-dirty workaround: Bot.on_command(self, event, context, *args)

I think it's better that dispatcher calls command handler without following command arguments.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions