示例#1
0
 async def audio_task(self):
     for i in range(len(self._nodes)):
         node = AudioNode(self, self.shards, self._nodes[i]["host"], self._nodes[i]["password"], self._nodes[i]["port"])
         await node.launch()
         self.nodes[node.host] = node
     self.bot.loop.create_task(self.audio_event_task())
     Logger.task("Audio event task has started.")
示例#2
0
async def on_ready():
    bot.started_at = time.time()
    Logger.info(
        f"Bot ready as: {bot.user} serving in {len(bot.guilds)} guilds with {len(bot.users)} users."
    )
    Logger.info("Loading cogs...")
    for cog in bot.cog_files:
        bot.load_extension(f"cogs.{cog}")
        Logger.info(f"Loaded cog: {cog}")
    Logger.info("All cogs loaded.")
    bot.loop.create_task(status_change())
    Logger.task("Status change has started.")
    bot.loop.create_task(bot.music_manager.audio_task())
    Logger.task("Audio task has started.")