# Erebus IRC bot - Author: John Runyon
# "Bot" and "BotConnection" classes (handling a specific "arm")
-#TODO: error checking
-
import socket, sys
#bots = {'erebus': bot.Bot(nick='Erebus', user='erebus', bind='', server='irc.quakenet.org', port=6667, realname='Erebus')}
self.parent.user(nick).quit()
del self.parent.users[nick.lower()]
- elif pieces[1] == "MODE": #TODO
+ elif pieces[1] == "MODE": #TODO parse for ops/voices (at least)
pass
pieces.pop(1)
else: # message was sent to a channel
- chan = self.parent.channel(target) #TODO check if bot's on channel --- in Erebus.channel() maybe?
+ chan = self.parent.channel(target)
try:
if msg[0] == '*': # message may be addressed to bot by "*BOTNICK" trigger?
if pieces[0][1:].lower() == self.nick.lower():
# Erebus IRC bot - Author: John Runyon
# main startup code
-#TODO: tons
-
import os, sys, select, MySQLdb, MySQLdb.cursors, time, random
import bot, config, ctlmod
else:
bot.msg(replyto, "Game is already started!")
-#FIXME @lib.hook('stop', clevel=lib.KNOWN, needchan=False)
-@lib.hook('stop', needchan=False) #FIXME
+@lib.hook('stop', clevel=lib.KNOWN, needchan=False)
def cmd_stop(bot, user, chan, realtarget, *args):
if stop():
bot.msg(state.chan, "Game stopped by %s" % (user))
@lib.hook('findq', clevel=lib.KNOWN, needchan=False)
def cmd_findquestion(bot, user, chan, realtarget, *args):
- matches = [str(i) for i in range(len(state.db['questions'])) if state.db['questions'][i]['question'] == ' '.join(args)] #FIXME: looser equality check
+ matches = [str(i) for i in range(len(state.db['questions'])) if state.db['questions'][i]['question'] == ' '.join(args)] #TODO looser equality check
if len(matches) > 1:
bot.msg(user, "Multiple matches: %s" % (', '.join(matches)))
elif len(matches) == 1: