mod_admin.py

Mon, 19 Jan 2015 16:42:36 -0500

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Mon, 19 Jan 2015 16:42:36 -0500
changeset 120
9880bb697149
parent 103
e4891ab34fb1
child 121
ac07779f788d
permissions
-rw-r--r--

- added doomseeker support, fixed up mod_bridge, now shortens new commit links with bit.ly

from modulecore import command_error
import hgapi

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',
		},
	]
}

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()

mercurial