aboutsummaryrefslogtreecommitdiff
path: root/discord/reaction.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 /discord/reaction.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 'discord/reaction.py')
-rw-r--r--discord/reaction.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/discord/reaction.py b/discord/reaction.py
index 34ef5333..d8829590 100644
--- a/discord/reaction.py
+++ b/discord/reaction.py
@@ -93,7 +93,7 @@ class Reaction:
return str(self.emoji)
def __repr__(self):
- return '<Reaction emoji={0.emoji!r} me={0.me} count={0.count}>'.format(self)
+ return f'<Reaction emoji={self.emoji!r} me={self.me} count={self.count}>'
async def remove(self, user):
"""|coro|
@@ -158,14 +158,14 @@ class Reaction:
# I do not actually recommend doing this.
async for user in reaction.users():
- await channel.send('{0} has reacted with {1.emoji}!'.format(user, reaction))
+ await channel.send(f'{user} has reacted with {reaction.emoji}!')
Flattening into a list: ::
users = await reaction.users().flatten()
# users is now a list of User...
winner = random.choice(users)
- await channel.send('{} has won the raffle.'.format(winner))
+ await channel.send(f'{winner} has won the raffle.')
Parameters
------------
@@ -191,7 +191,7 @@ class Reaction:
"""
if self.custom_emoji:
- emoji = '{0.name}:{0.id}'.format(self.emoji)
+ emoji = f'{self.emoji.name}:{self.emoji.id}'
else:
emoji = self.emoji