def __init__(self, bot): super().__init__(bot) self.editing = set() self.messages = dict() self.config = ConfigTable(bot, table='role', primary='guild_id')
def __init__(self, bot): super().__init__(bot) self.config = ConfigTable(bot, 'mod_config', 'guild_id', record_class=SecurityConfigRecord) self.event_timer = EventTimer(bot, 'event_complete')
def __init__(self, bot): super().__init__(bot) self.config = ConfigTable(bot, 'trivia', ('guild_id', 'user_id')) self.trivia_categories = None self.bot.loop.create_task(self.get_trivia_categories())
def __init__(self, bot): super().__init__(bot) self.editing = set() self.messages = dict() self.footer_tasks = dict() self.footer_lock = asyncio.Lock() self.config = ConfigTable(bot, table='role', primary='guild_id')
def __init__(self, bot): super().__init__(bot) self.config = ConfigTable(bot, 'mod_config', 'guild_id', record_class=SecurityConfigRecord) self.event_timer = EventTimer(bot, 'event_complete') asyncio.create_task(self.check_tempbans())
def __init__(self, db, **kwargs): super().__init__(command_prefix=self.prefix_resolver, owner_id=OWNER_ID, description=DESCRIPTION, help_command=EditedMinimalHelpCommand(), max_messages=20000, activity=BOT_ACTIVITY, **kwargs) self.db = db self.config = ConfigTable(self, table='config', primary='guild_id', record_class=GuildConfigRecord) self.ready = asyncio.Event() self.startup_time = datetime.utcnow() aiohttp_log = logging.getLogger('aiotrace') async def on_request_end(session, ctx, end): resp = end.response aiohttp_log.info('[%s %s] %s %s (%s)', str(resp.status), resp.reason, end.method.upper(), end.url, resp.content_type) trace_config = aiohttp.TraceConfig() trace_config.on_request_end.append(on_request_end) self.aiohttp = aiohttp.ClientSession( loop=self.loop, timeout=aiohttp.ClientTimeout(total=5), trace_configs=[trace_config], ) self.modified_times = dict() # help command. this is messy but it has to be because the lib doesn't really like you having # two different help commands. maybe I will see if I can clean this up in the future self.static_help_command = self.help_command command_impl = self.help_command._command_impl self.help_command = PaginatedHelpCommand() self.static_help_command._command_impl = command_impl self.remove_command('help') self.add_command(commands.Command(self._help, name='help'))
def __init__(self, bot): super().__init__(bot) self.config = ConfigTable(bot, table='starboard', primary='guild_id', record_class=StarboardConfigRecord) self.purge_query = ''' SELECT id, guild_id, channel_id, star_message_id FROM star_msg WHERE guild_id = $1 AND starred_at < $2 AND (SELECT COUNT(id) FROM starrers WHERE starrers.star_id=star_msg.id) < $3 ''' self.purger.start()
def __init__(self, **kwargs): super().__init__(command_prefix=self.prefix_resolver, owner_id=OWNER_ID, description=DESCRIPTION, help_command=PaginatedHelpCommand(), max_messages=20000, activity=disnake.Game('Booting up...'), status=disnake.Status.do_not_disturb, **kwargs) # created in login self.db = None self.config = ConfigTable(self, table='config', primary='guild_id', record_class=GuildConfigRecord) self.startup_time = datetime.utcnow() self.log = logging.getLogger('acebot') aiohttp_log = logging.getLogger('http') async def on_request_end(session, ctx, end): resp = end.response aiohttp_log.info('[%s %s] %s %s (%s)', str(resp.status), resp.reason, end.method.upper(), end.url, resp.content_type) trace_config = aiohttp.TraceConfig() trace_config.on_request_end.append(on_request_end) self.aiohttp = aiohttp.ClientSession( loop=self.loop, timeout=aiohttp.ClientTimeout(total=5), trace_configs=[trace_config], ) self.modified_times = dict()
def __init__(self, bot): super().__init__(bot) self.config = ConfigTable(bot, 'welcome', 'guild_id', WelcomeRecord)
def __init__(self, bot): super().__init__(bot) self.config = ConfigTable(bot, 'trivia', ('guild_id', 'user_id')) self.trivia_categories = None