mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-07 10:22:59 +00:00
Modernize code to use f-strings
This also removes the encoding on the top, since Python 3 does it by default. It also changes some methods to use `yield from`.
This commit is contained in:
@ -25,12 +25,12 @@ class MyClient(discord.Client):
|
||||
try:
|
||||
guess = await self.wait_for('message', check=is_correct, timeout=5.0)
|
||||
except asyncio.TimeoutError:
|
||||
return await message.channel.send('Sorry, you took too long it was {}.'.format(answer))
|
||||
return await message.channel.send(f'Sorry, you took too long it was {answer}.')
|
||||
|
||||
if int(guess.content) == answer:
|
||||
await message.channel.send('You are right!')
|
||||
else:
|
||||
await message.channel.send('Oops. It is actually {}.'.format(answer))
|
||||
await message.channel.send(f'Oops. It is actually {answer}.')
|
||||
|
||||
client = MyClient()
|
||||
client.run('token')
|
||||
|
Reference in New Issue
Block a user