Use f-strings in more places that were missed

This commit is contained in:
Sebastian Law
2021-04-08 06:31:06 -07:00
committed by GitHub
parent 99fc950510
commit 05c123f3ab
7 changed files with 19 additions and 18 deletions

View File

@ -33,16 +33,16 @@ This example cog defines a ``Greetings`` category for your commands, with a sing
async def on_member_join(self, member):
channel = member.guild.system_channel
if channel is not None:
await channel.send('Welcome {0.mention}.'.format(member))
await channel.send(f'Welcome {member.mention}.')
@commands.command()
async def hello(self, ctx, *, member: discord.Member = None):
"""Says hello"""
member = member or ctx.author
if self._last_member is None or self._last_member.id != member.id:
await ctx.send('Hello {0.name}~'.format(member))
await ctx.send(f'Hello {member.name}~')
else:
await ctx.send('Hello {0.name}... This feels familiar.'.format(member))
await ctx.send(f'Hello {member.name}... This feels familiar.')
self._last_member = member
A couple of technical notes to take into consideration: