def __init__(self): IRCCommand.__init__(self, 'coerce', self.game_trigger) #hash of channel to CoercionGame object. self.games = {} self.triggers['PRIVMSG'] = (9, self.privmsg) self.score = {}
def __init__(self, phrase): def fun(user, chan, args): response = phrase_maker.make(self.phrase, user) self.owner.send_privmsg(chan, response) IRCCommand.__init__(self, phrase, fun) self.phrase = phrase
def __init__(self): IRCCommand.__init__( self, 'stats', self.stats_cmd, args='[<keyword>]*', description= 'Show various stats from active modules. Will show a random stat that fits with the keywords given.' ) self.modules = []
def __init__(self, filename = None): IRCCommand.__init__(self, 'markov', None) self.filename = filename self.forward = {} self.backward = {} self.start = [] self.end = [] self.min_length = 5 self.triggers['PRIVMSG'] = (9, self.privmsg) if self.filename: self.load()
def main(): bot = IRCBot(host="irc.sudo-rmrf.net", port=6667, channel="#bot", nick="testbot") h = Help("Intro", "Outro").register(bot) UserTracker().register(bot) LastMessage().register(bot) Stats().register(bot) IRCCommand('boop', lambda user, chan, args: bot.fire(sendmessage(chan, user.nick + ': bop'))).register(bot) d = Debugger().register(bot) bot.run()
def __init__(self): IRCCommand.__init__(self, 'last', self.last_cmd, args='<username>', description='Shows the last activity by the given user.')
def __init__(self): IRCCommand.__init__(self, 'stats', self.stats_cmd, args='[<keyword>]*', description='Show various stats from active modules. Will show a random stat that fits with the keywords given.') self.modules = []
def __init__(self, intro=None, outro=None): IRCCommand.__init__(self, 'help', self.help_cmd, args='<module> [<subcommands>]', description='Show detailed information on active modules. For modules that have subtopics, add extra arguments for each one.') self.intro = intro self.outro = outro self.modules = []
def __init__(self, link_file): IRCCommand.__init__(self, 'link', self.link_trigger) self.link_file = link_file self.load()