示例#1
0
 def __init__(self, bot, moduleName):
     ModuleBase.__init__(self, bot, moduleName)
     self.hooks = [
         ModuleHook("PRIVMSG", self.got_msg),
         ModuleHook("JOIN", self.join_ch)
     ]
     self.loadConfig()
     self.games = {}
示例#2
0
 def __init__(self, bot, moduleName):
     ModuleBase.__init__(self, bot, moduleName)
     self.hooks.append(ModuleHook("PRIVMSG", self.handleMessage))
     self.prefixes = [person for person in self.config["people"]]
     self.bot = bot
     self.timer = None
     self.setupTimer()
示例#3
0
 def __init__(self, bot, moduleName):
     ModuleBase.__init__(self, bot, moduleName)
     self.hooks = [ModuleHook("PRIVMSG", self.gotmsg)]
     # Load attribute storage
     self.attr = self.bot.getBestModuleForService("attributes")
     # Load doge RPC
     self.doge = self.bot.getBestModuleForService("dogerpc")
示例#4
0
 def __init__(self, bot, moduleName):
     ModuleBase.__init__(self, bot, moduleName)
     self.hooks = [ModuleHook("PRIVMSG", self.gotMsg)]
     # Load attribute storage
     self.attr = self.bot.getBestModuleForService("attributes")
     # Load doge RPC
     self.doge = self.bot.getBestModuleForService("dogerpc")
     # Dict of #channel -> game object
     self.games = {}
示例#5
0
    def __init__(self, bot, moduleName):
        # init the base module
        ModuleBase.__init__(self, bot, moduleName)
        self.hooks = [ModuleHook("PRIVMSG", self.scramble)]

        # Dictionary
        self.whitesFile = open(self.getFilePath("answers.txt"), 'r')
        self.blacksFile = open(self.getFilePath("questions.txt"), 'r')
        self.whites = [line.rstrip() for line in self.whitesFile]
        self.blacks = [line.rstrip() for line in self.blacksFile]
        self.currentBlack = ""
        self.whitesFile.close()
        self.blacksFile.close()
        self.log.info("CAH: Loaded." + str(len(self.whites)) +
                      " White Cards " + str(len(self.blacks)) + " Black Cards")
        # Per channel games
        self.games = {}
示例#6
0
    def __init__(self, bot, moduleName):
        ModuleBase.__init__(self, bot, moduleName)
        self.hooks = [ModuleHook("PRIVMSG", self.scramble)]
        # Load attribute storage
        self.attr = None
        serviceProviders = self.bot.getmodulesbyservice("attributes")
        if len(serviceProviders) == 0:
            self.log.error(
                "DogeScramble: Could not find a valid attributes service provider"
            )
        else:
            self.log.info(
                "DogeScramble: Selecting attributes service provider: %s" %
                serviceProviders[0])
            self.attr = serviceProviders[0]

        # Load doge RPC
        self.doge = self.bot.getBestModuleForService("dogerpc")

        # Per channel games
        self.games = {}
示例#7
0
 def __init__(self, bot, moduleName):
     ModuleBase.__init__(self, bot, moduleName)
     self.hooks = [ModuleHook("PRIVMSG", self.dotest)]
示例#8
0
 def __init__(self, bot, moduleName):
     ModuleBase.__init__(self, bot, moduleName)
     self.loadConfig()
     print(self.config)
     self.hooks=[ModuleHook("PRIVMSG", self.echo)]