Merge pull request #18 from Aakash-kun/patch-2

Added some fixes to the advanced example.
This commit is contained in:
VP 2022-01-08 07:14:08 +02:00 committed by GitHub
commit c0fd4fe734
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -89,11 +89,14 @@ class Music(commands.Cog):
self.pomice = pomice.NodePool() self.pomice = pomice.NodePool()
# Start the node # Start the node
bot.loop.create_task(self.start_nodes) bot.loop.create_task(self.start_nodes())
async def start_nodes(self): async def start_nodes(self):
# Waiting for the bot to get ready before connecting to nodes.
await self.bot.wait_until_ready()
# You can pass in Spotify credentials to enable Spotify querying. # You can pass in Spotify credentials to enable Spotify querying.
# If you do not pass in valid Spotify credentials, Spotify querying will not work # If you do not pass in valid Spotify credentials, Spotify querying will not work
await self.pomice.create_node( await self.pomice.create_node(
bot=self.bot, bot=self.bot,
host="127.0.0.1", host="127.0.0.1",