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 /discord/reaction.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 'discord/reaction.py')
| -rw-r--r-- | discord/reaction.py | 8 |
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 |