Use f-strings in more places that were missed.

This commit is contained in:
Rapptz
2021-04-08 06:02:47 -04:00
parent c3e0b6e123
commit 99fc950510
34 changed files with 220 additions and 143 deletions

View File

@ -4,7 +4,7 @@ import asyncio
class MyClient(discord.Client):
async def on_ready(self):
print('Connected!')
print('Username: {0.name}\nID: {0.id}'.format(self.user))
print(f'Username: {self.user.name}\nID: {self.user.id}')
async def on_message(self, message):
if message.content.startswith('!editme'):
@ -13,8 +13,8 @@ class MyClient(discord.Client):
await msg.edit(content='40')
async def on_message_edit(self, before, after):
fmt = '**{0.author}** edited their message:\n{0.content} -> {1.content}'
await before.channel.send(fmt.format(before, after))
msg = f'**{before.author}** edited their message:\n{before.content} -> {after.content}'
await before.channel.send(msg)
client = MyClient()
client.run('token')