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