# Erebus IRC bot - Author: Erebus Team
+# vim: fileencoding=utf-8
# This file is released into the public domain; see http://unlicense.org/
# module info
modinfo = {
'author': 'Erebus Team',
'license': 'public domain',
- 'compatible': [1,2],
+ 'compatible': [0],
'depends': [],
'softdeps': ['help'],
}
modstop = lib.modstop
# module code
-@lib.hook(clevel=lib.OP)
+import time
+
+@lib.hook(('say','cmsg'), clevel=lib.OP)
@lib.help('<message>', 'sends message to channel')
@lib.argsGE(1)
-def cmsg(bot, user, chan, realtarget, *args):
+def say(bot, user, chan, realtarget, *args):
chan.msg(' '.join(args))
def _getbot(bot, user, chan, realtarget, *args):
target = None
- if args[0][0] == "#":
+ if args[0].startswith("#"):
target = bot.parent.channel(args[0])
- print "target = %s" % (target)
- if target is not None:
sendbot = target.bot
- print "bot = %s" % (sendbot)
else:
target = args[0]
sendbot = bot.parent.randbot()
- print "bot = random"
return (target, sendbot)
@lib.hook(glevel=lib.STAFF, needchan=False)
target, sendbot = _getbot(bot, user, chan, realtarget, *args)
sendbot.conn.send("PRIVMSG %s :%s" % (args[0], ' '.join(args[1:])))
-@lib.hook()
+@lib.hook(glevel=lib.MANAGER, needchan=False)
+@lib.argsEQ(1)
def moo(bot, user, chan, realtarget, *args):
- for i in [' .= , =.\n', " _ _ /'/ )\\,/,/(_ \\ \\\n", ' `//-.| ( ,\\\\)\\//\\)\\/_ ) |\n', " //___\\ `\\\\\\/\\\\/\\/\\\\///' /\n", ',-"~`-._ `"--\'_ `"""` _ \\`\'"~-,_\n', '\\ `-. \'_`. .\'_` \\ ,-"~`/\n', " `.__.-'`/ (-\\ /-) |-.__,'\n", ' || | \\O) /^\\ (O/ |\n', ' `\\\\ | / `\\ /\n', ' \\\\ \\ / `\\ /\n', " `\\\\ `-. /' .---.--.\\\n", " `\\\\/`~(, '() ('\n", ' /(O) \\\\ _,.-.,_)\n', " // \\\\ `\\'` /\n", ' / | || `""""~"`\n', " /' |__||\n", ' `o\n']:
- bot.fastmsg(chan, i.rstrip("\n"))
+ lines= [' .= , =.', " _ _ /'/ )\\,/,/(_ \\ \\", ' `//-.| ( ,\\\\)\\//\\)\\/_ ) |', " //___\\ `\\\\\\/\\\\/\\/\\\\///' /", ',-"~`-._ `"--\'_ `"""` _ \\`\'"~-,_', '\\ `-. \'_`. .\'_` \\ ,-"~`/', " `.__.-'`/ (-\\ /-) |-.__,'", ' || | \\O) /^\\ (O/ |', ' `\\\\ | / `\\ /', ' \\\\ \\ / `\\ /', " `\\\\ `-. /' .---.--.\\", " `\\\\/`~(, '() ('", ' /(O) \\\\ _,.-.,_)', " // \\\\ `\\'` /", ' / | || `""""~"`', " /' |__||", ' `o']
+ for i in range(len(lines)):
+ sender = bot.parent.bots.values()[i%len(bot.parent.bots.values())]
+ mylen = len(sender.nick)
+ padding = 15-mylen
+ sender.fastmsg(args[0], " "*padding + lines[i])
+ time.sleep(0.1)