Sun, 19 Apr 2015 22:46:39 +0300
- reverted previous commit (now that was a bad idea)
from modulecore import command_error import sys ModuleData = { 'commands': [ { 'name': 'raw', 'description': 'Sends a raw message to the server', 'args': '<message...>', 'level': 'admin', }, { 'name': 'msg', 'description': 'Sends a message to someone', 'args': '<recipient> <message...>', 'level': 'admin', }, { 'name': 'restart', 'description': 'Restarts the bot', 'args': None, 'level': 'admin', }, { 'name': 'die', 'description': 'Shuts the bot down', 'args': None, 'level': 'admin', }, { 'name': 'modreload', 'description': 'Reloads a module', 'args': '<module>', 'level': 'admin', }, ] } def cmd_raw (bot, args, **rest): bot.write (args['message']) def cmd_msg (bot, args, **rest): bot.privmsg (args['recipient'], args['message']) def cmd_restart (bot, **rest): bot.restart() def cmd_die (bot, **rest): quit() def cmd_modreload (bot, args, **rest): reload (sys.modules[args['module']])