Added full reload functionality
This commit is contained in:
parent
38e571000e
commit
a79a45f4ab
@ -12,12 +12,17 @@ from . import MODULE, Plugin
|
||||
# noinspection PyUnusedLocal
|
||||
@command(permission='admin', show_in_help_list=False)
|
||||
def reload(bot: IrcBot, mask: IrcString, channel: IrcString, args: DocoptDict):
|
||||
"""Reload a plugin
|
||||
%%reload <plugin>
|
||||
"""Reloads a plugin or the whole bot
|
||||
|
||||
%%reload [<plugin>]
|
||||
"""
|
||||
plugin = args['<plugin>']
|
||||
bot.reload('{module}.{plugin}'.format(plugin=plugin, module=MODULE))
|
||||
bot.notice(mask.nick, 'Reloaded plugin "{plugin}"'.format(plugin=plugin))
|
||||
plugin = args.get('<plugin>')
|
||||
if plugin:
|
||||
bot.reload('{module}.{plugin}'.format(plugin=plugin, module=MODULE))
|
||||
bot.privmsg(channel, 'Reloaded plugin "{}"'.format(plugin))
|
||||
else:
|
||||
bot.reload()
|
||||
bot.privmsg(channel, 'Reloaded the bot')
|
||||
|
||||
|
||||
@irc3.plugin
|
||||
|
Loading…
Reference in New Issue
Block a user