async def init_cog(self) -> None: """Initialise the help channel system.""" log.trace( "Waiting for the guild to be available before initialisation.") await self.bot.wait_until_guild_available() log.trace("Initialising the cog.") await self.init_categories() await _cooldown.check_cooldowns(self.scheduler) self.channel_queue = self.create_channel_queue() self.name_queue = _name.create_name_queue( self.available_category, self.in_use_category, self.dormant_category, ) log.trace("Moving or rescheduling in-use channels.") for channel in _channel.get_category_channels(self.in_use_category): await self.move_idle_channel(channel, has_task=False) # Prevent the command from being used until ready. # The ready event wasn't used because channels could change categories between the time # the command is invoked and the cog is ready (e.g. if move_idle_channel wasn't called yet). # This may confuse users. So would potentially long delays for the cog to become ready. self.close_command.enabled = True await self.init_available() _stats.report_counts() log.info("Cog is ready!")
async def init_cog(self) -> None: """Initialise the help channel system.""" log.trace( "Waiting for the guild to be available before initialisation.") await self.bot.wait_until_guild_available() log.trace("Initialising the cog.") self.guild = self.bot.get_guild(constants.Guild.id) self.cooldown_role = self.guild.get_role(constants.Roles.help_cooldown) await self.init_categories() self.channel_queue = self.create_channel_queue() self.name_queue = _name.create_name_queue( self.available_category, self.in_use_category, self.dormant_category, ) log.trace("Moving or rescheduling in-use channels.") for channel in _channel.get_category_channels(self.in_use_category): await self.move_idle_channel(channel, has_task=False) # Prevent the command from being used until ready. # The ready event wasn't used because channels could change categories between the time # the command is invoked and the cog is ready (e.g. if move_idle_channel wasn't called yet). # This may confuse users. So would potentially long delays for the cog to become ready. self.close_command.enabled = True # Acquiring the dynamic message ID, if it exists within the cache. log.trace("Attempting to fetch How-to-get-help dynamic message ID.") self.dynamic_message = await _caches.dynamic_message.get("message_id") await self.init_available() _stats.report_counts() log.info("Cog is ready!")