Description
There is a bug in the on_commands method when a single string is passed instead of a list of commands. The method will incorrectly trigger on each character of the string rather than treating the entire string as a single command.
Steps to Reproduce
Define a handler using the on_commands decorator and pass a string as the commands argument (e.g., "start" instead of ["start"]).
Send a message that contains any of the characters in the string.
Expected Behavior
The handler should only trigger when the message matches the full string provided as the command.
Actual Behavior
The handler triggers on any message that contains any character from the provided string.
In this case, the handler will trigger on any message containing the letters "s", "t", "a", "r", or "t" rather than just the word "start".
Suggested Fix
The method should validate the commands parameter to ensure that it is a list. If a string is passed, it should convert it to a single-element list.
Description There is a bug in the on_commands method when a single string is passed instead of a list of commands. The method will incorrectly trigger on each character of the string rather than treating the entire string as a single command.
Steps to Reproduce
Expected Behavior The handler should only trigger when the message matches the full string provided as the command.
Actual Behavior The handler triggers on any message that contains any character from the provided string.
Example Code
In this case, the handler will trigger on any message containing the letters "s", "t", "a", "r", or "t" rather than just the word "start".
Suggested Fix The method should validate the commands parameter to ensure that it is a list. If a string is passed, it should convert it to a single-element list.