- Notifications
You must be signed in to change notification settings - Fork 28
Exceptions
sharkbound edited this page Sep 3, 2022
·
10 revisions
Used to trigger an automatic error message showing the reason for the error (passed as reason=
in InvalidArgumentsError(reason='<message to chat here>'))
example:
fromtwitchbotimportCommand, Message, InvalidArgumentsError@Command(name='error')asyncdefcmd_test(msg: Message):
raiseInvalidArgumentsError(reason='<message to chat here>',
cmd=cmd_test) # cmd= is not required, but is used to signal which command raised the errorThe above code will print this error message in twitch chat:
<message to chat here> - syntax: "" - do "?help error" for more details