aboutsummaryrefslogtreecommitdiff
path: root/examples/edits.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-04-08 06:02:47 -0400
committerRapptz <[email protected]>2021-04-08 06:02:47 -0400
commit99fc9505107183faa59aad9e7753f293eba88836 (patch)
treef615ac678c5dc194fd2aa3a9a048a188b761b0d9 /examples/edits.py
parentUpdate joined command in basic_bot to use f-strings (diff)
downloaddiscord.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.py6
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')