def __init__(self, bot, options): # Hook the base plugin BasePlugin.__init__(self, bot, options) # Control output self.output = True # Initialize variables self.resetdata()
def __init__(self, bot, options): BasePlugin.__init__(self, bot, options) self.users = {} self.conf = ConfigObj("users.ini") try: if options["authtype"] == "nickserv": self.authtype = "nickserv" else: self.authtype = "pygbot" except: self.authtype = "pygbot"
def __init__(self, bot, options): BasePlugin.__init__(self, bot, options) # Get channel try: if options['channel'][0] not in CHANNEL_PREFIXES: self.channel = '#' + options['channel'] else: self.channel = options['channel'] except KeyError, IndexError: self.channel = None log.logger.error("Log2channel: No log channel specified")
def __init__(self, bot, options): BasePlugin.__init__(self, bot, options) if self.bot.plugins.has_key('system.Auth') == False: raise StandardError('Unable to load Auth plugin. Please ensure it is loaded first.') if options.has_key('_prefix'): self.cmdprefix = options['_prefix'] else: self.cmdprefix = '^' self.commands = {} for friendlyname, commandname in options.iteritems(): if not friendlyname.startswith('_'): log.logger.info("Importing command " + commandname + " with friendly name " + friendlyname) command = __import__("pyGBot.Plugins.system.CommandSpec." + commandname, fromlist = [commandname]) self.commands[friendlyname] = getattr(command, commandname)
def __init__(self, bot, options): BasePlugin.__init__(self, bot, options) # default options self.useShortUrl = False self.maxMessageSize = 510 self.wikiName = 'Wikipedia' self.wikiUrl = 'http://en.wikipedia.org' self.wikiApi = '/w/api.php' self.wikiBase = '/wiki' self.wikiSave = {} # settings push/pop from here # private attributes self.active = False self.lastResponse = {} self.lastTitle = u"" # retrieve options from configuration if 'shortUrl' in options: self.useShortUrl = (options['shortUrl'][0].upper()!='F') if 'maxMessageSize' in options: self.maxMessageSize = min(self.maxMessageSize, int(options['maxMessageSize'])) if 'wikiName' in options: self.wikiName = options['wikiName'].strip() if 'wikiUrl' in options: self.wikiUrl = options['wikiUrl'].rstrip('/\\?') if 'wikiApi' in options: if options['wikiApi'][0] != '/': self.wikiApi = '/' + options['wikiApi'].rstrip('/\\?') else: self.wikiApi = options['wikiApi'].rstrip('/\\?') if 'wikiBase' in options: if options['wikiBase'][0] != '/': self.wikiBase = '/' + options['wikiBase'].rstrip('/\\?') else: self.wikiBase = options['wikiBase'].rstrip('/\\?')
def __init__(self, bot, options): BasePlugin.__init__(self, bot, options) self.game_running = False
def __init__(self, bot, options): BasePlugin.__init__(self, bot, options) self.tourney = []
def __init__(self, bot, options): BasePlugin.__init__(self, bot, options) self.users = {} self.conf = ConfigObj("users.ini")
def __init__(self, bot, options): BasePlugin.__init__(self, bot, options) self.plugins = options.keys()
def __init__(self, bot, options): BasePlugin.__init__(self, bot, options) self.activeGame = False self.output = True self.modbreak = re.compile('([\+\-\*\/%^].*)')
def __init__(self, bot, options): BasePlugin.__init__(self, bot, options) self.activeGame = False self.output = True
def __init__(self, bot, options): BasePlugin.__init__(self, bot, options) self.options = options self.users = {} self.user_handlers = {}
def __init__(self, bot, options): BasePlugin.__init__(self, bot, options) self.output = True self.moderation = True