Beispiel #1
0
  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 = {}
Beispiel #2
0
    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
Beispiel #3
0
 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 = []
Beispiel #4
0
    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()
Beispiel #5
0
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()
Beispiel #6
0
 def __init__(self):
     IRCCommand.__init__(self, 'last', self.last_cmd, args='<username>',
                         description='Shows the last activity by the given user.')
Beispiel #7
0
 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 = []
Beispiel #8
0
 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 = []
Beispiel #9
0
 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 = []
Beispiel #10
0
    def __init__(self, link_file):
        IRCCommand.__init__(self, 'link', self.link_trigger)

        self.link_file = link_file
        self.load()