diff options
Diffstat (limited to 'examples/basic_voice.py')
| -rw-r--r-- | examples/basic_voice.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/basic_voice.py b/examples/basic_voice.py index 42cea2c8..45387911 100644 --- a/examples/basic_voice.py +++ b/examples/basic_voice.py @@ -70,9 +70,9 @@ class Music(commands.Cog): """Plays a file from the local filesystem""" source = discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(query)) - ctx.voice_client.play(source, after=lambda e: print('Player error: %s' % e) if e else None) + ctx.voice_client.play(source, after=lambda e: print(f'Player error: {e}') if e else None) - await ctx.send('Now playing: {}'.format(query)) + await ctx.send(f'Now playing: {query}') @commands.command() async def yt(self, ctx, *, url): @@ -80,9 +80,9 @@ class Music(commands.Cog): async with ctx.typing(): 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) + ctx.voice_client.play(player, after=lambda e: print(f'Player error: {e}') if e else None) - await ctx.send('Now playing: {}'.format(player.title)) + await ctx.send(f'Now playing: {player.title}') @commands.command() async def stream(self, ctx, *, url): @@ -90,9 +90,9 @@ class Music(commands.Cog): async with ctx.typing(): player = await YTDLSource.from_url(url, loop=self.bot.loop, stream=True) - ctx.voice_client.play(player, after=lambda e: print('Player error: %s' % e) if e else None) + ctx.voice_client.play(player, after=lambda e: print(f'Player error: {e}') if e else None) - await ctx.send('Now playing: {}'.format(player.title)) + await ctx.send(f'Now playing: {player.title}') @commands.command() async def volume(self, ctx, volume: int): @@ -102,7 +102,7 @@ class Music(commands.Cog): return await ctx.send("Not connected to a voice channel.") ctx.voice_client.source.volume = volume / 100 - await ctx.send("Changed volume to {}%".format(volume)) + await ctx.send(f"Changed volume to {volume}%") @commands.command() async def stop(self, ctx): |