mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-22 00:13:01 +00:00
Use f-strings in more places that were missed.
This commit is contained in:
@@ -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
|
||||
-----------
|
||||
|
Reference in New Issue
Block a user