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/guild.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/guild.py')
| -rw-r--r-- | discord/guild.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/discord/guild.py b/discord/guild.py index 51d2004f..a3343686 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -839,7 +839,7 @@ class Guild(Hashable): perms = [] for target, perm in overwrites.items(): if not isinstance(perm, PermissionOverwrite): - raise InvalidArgument('Expected PermissionOverwrite received {0.__name__}'.format(type(perm))) + raise InvalidArgument(f'Expected PermissionOverwrite received {perm.__class__.__name__}') allow, deny = perm.pair() payload = { @@ -2105,17 +2105,17 @@ class Guild(Hashable): Getting the first 100 entries: :: async for entry in guild.audit_logs(limit=100): - print('{0.user} did {0.action} to {0.target}'.format(entry)) + print(f'{entry.user} did {entry.action} to {entry.target}') Getting entries for a specific action: :: async for entry in guild.audit_logs(action=discord.AuditLogAction.ban): - print('{0.user} banned {0.target}'.format(entry)) + print(f'{entry.user} banned {entry.target}') Getting entries made by a specific user: :: entries = await guild.audit_logs(limit=None, user=guild.me).flatten() - await channel.send('I made {} moderation actions.'.format(len(entries))) + await channel.send(f'I made {len(entries)} moderation actions.') Parameters ----------- |