ezbotf.exceptions
Note
This module is imports as from .. import exceptions
. This means that you must use ezbotf.exceptions.PluginError
as example.
ezbotf.exceptions
PluginError
__init__
Example for plugin:
import ezbotf
plugin = ezbotf.Plugin(ezbotf.PluginType.Standalone)
class SpecialFailError(ezbotf.exceptions.PluginError):
def __init__(self):
super().__init__('specially failed for the example')
# NOTE: This will be interpreted as:
# >>> MyPlugin.SpecialFailError: Plugin "FailPlugin" specially failed for the example
@plugin.on_load
def on_load():
@plugin.command('forcefail')
async def forcefail(event, args):
raise SpecialFailError() # Raise our error
# You can also use:
# raise ezbotf.exceptions.PluginError('specially failed for the example')
IncorrectInstanceConfigError
__init__
Note
This exception is only used if config given to instance is incorrect