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

@ -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