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/channel.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/channel.py')
| -rw-r--r-- | discord/channel.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/discord/channel.py b/discord/channel.py index 5c6eed1e..314485d6 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -320,7 +320,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): return m.author == client.user deleted = await channel.purge(limit=100, check=is_me) - await channel.send('Deleted {} message(s)'.format(len(deleted))) + await channel.send(f'Deleted {len(deleted)} message(s)') Parameters ----------- @@ -504,7 +504,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): raise ClientException('The channel must be a news channel.') if not isinstance(destination, TextChannel): - raise InvalidArgument('Expected TextChannel received {0.__name__}'.format(type(destination))) + raise InvalidArgument(f'Expected TextChannel received {destination.__class__.__name__}') from .webhook import Webhook data = await self._state.http.follow_webhook(self.id, webhook_channel_id=destination.id, reason=reason) @@ -896,7 +896,7 @@ class CategoryChannel(discord.abc.GuildChannel, Hashable): self._update(guild, data) def __repr__(self): - return '<CategoryChannel id={0.id} name={0.name!r} position={0.position} nsfw={0.nsfw}>'.format(self) + return f'<CategoryChannel id={self.id} name={self.name!r} position={self.position} nsfw={self.nsfw}>' def _update(self, guild, data): self.guild = guild @@ -1092,7 +1092,7 @@ class StoreChannel(discord.abc.GuildChannel, Hashable): self._update(guild, data) def __repr__(self): - return '<StoreChannel id={0.id} name={0.name!r} position={0.position} nsfw={0.nsfw}>'.format(self) + return f'<StoreChannel id={self.id} name={self.name!r} position={self.position} nsfw={self.nsfw}>' def _update(self, guild, data): self.guild = guild @@ -1218,7 +1218,7 @@ class DMChannel(discord.abc.Messageable, Hashable): return f'Direct Message with {self.recipient}' def __repr__(self): - return '<DMChannel id={0.id} recipient={0.recipient!r}>'.format(self) + return f'<DMChannel id={self.id} recipient={self.recipient!r}>' @property def type(self): @@ -1354,7 +1354,7 @@ class GroupChannel(discord.abc.Messageable, Hashable): return ', '.join(map(lambda x: x.name, self.recipients)) def __repr__(self): - return '<GroupChannel id={0.id} name={0.name!r}>'.format(self) + return f'<GroupChannel id={self.id} name={self.name!r}>' @property def type(self): |