aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDaniel <[email protected]>2017-07-07 22:09:56 -0400
committerGitHub <[email protected]>2017-07-07 22:09:56 -0400
commit6f42a5f2ecbdc4ad00832ab93974cfc9c404250b (patch)
treef5248b842b4477fb3e044582d99dd61af32df865 /examples
parent[commands] unload cog submodules (diff)
downloaddiscord.py-6f42a5f2ecbdc4ad00832ab93974cfc9c404250b.tar.xz
discord.py-6f42a5f2ecbdc4ad00832ab93974cfc9c404250b.zip
Fixed broken code
I should have tested it.
Diffstat (limited to 'examples')
-rw-r--r--examples/basic_voice.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/basic_voice.py b/examples/basic_voice.py
index be971690..a689cc97 100644
--- a/examples/basic_voice.py
+++ b/examples/basic_voice.py
@@ -43,7 +43,7 @@ class YTDLSource(discord.PCMVolumeTransformer):
@classmethod
async def from_url(cls, url, *, loop=None):
loop = loop or asyncio.get_event_loop()
- data = await loop.run_in_executor(ytdl.extract_info, url)
+ data = await loop.run_in_executor(None, ytdl.extract_info, url)
if 'entries' in data:
# take first item from a playlist
@@ -97,7 +97,7 @@ class Music:
if ctx.voice_client.is_playing():
ctx.voice_client.stop()
- player = await YoutubeSource.from_url(query, loop=self.bot.loop)
+ player = await YTDLSource.from_url(url, loop=self.bot.loop)
ctx.voice_client.play(player, after=lambda e: print('Player error: %s' % e) if e else None)
await ctx.send('Now playing: {}'.format(player.title))