Skip to content

Exceptions

sharkbound edited this page Feb 15, 2019 · 10 revisions

InvalidArgumentsError

used to trigger a help message in chat for a command when the use gives bad input example:

from twitchbot import Command, Message, InvalidArgumentsError
@Command(name='test', help='testing command, ignore me', syntax='(no special syntax)')
async def cmd_test(msg: Message, *args):
    raise InvalidArgumentsError

when called, this command will send this to chat: f'invalid arguments - "!test (no special syntax)" - do "!help test" for more details

Clone this wiki locally