diff options
| author | Rapptz <[email protected]> | 2021-04-08 06:02:47 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-04-08 06:02:47 -0400 |
| commit | 99fc9505107183faa59aad9e7753f293eba88836 (patch) | |
| tree | f615ac678c5dc194fd2aa3a9a048a188b761b0d9 /examples/edits.py | |
| parent | Update joined command in basic_bot to use f-strings (diff) | |
| download | discord.py-99fc9505107183faa59aad9e7753f293eba88836.tar.xz discord.py-99fc9505107183faa59aad9e7753f293eba88836.zip | |
Use f-strings in more places that were missed.
Diffstat (limited to 'examples/edits.py')
| -rw-r--r-- | examples/edits.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/edits.py b/examples/edits.py index 2c1db4d9..375a9bde 100644 --- a/examples/edits.py +++ b/examples/edits.py @@ -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') |