1
0
Fork 0
mirror of https://github.com/uhIgnacio/EmoteManager.git synced 2024-08-15 02:23:13 +00:00

fix SyntaxWarning: invalid escape sequence \: in 3.8

This commit is contained in:
Benjamin Mintz 2019-06-13 19:49:35 +00:00
parent b657892b3b
commit 05bcf4a412

View file

@ -223,7 +223,7 @@ class Emotes(commands.Cog):
if not emotes: if not emotes:
emote = await self.parse_emote(context, emote) emote = await self.parse_emote(context, emote)
await emote.delete(reason=f'Removed by {utils.format_user(self.bot, context.author.id)}') await emote.delete(reason=f'Removed by {utils.format_user(self.bot, context.author.id)}')
await context.send(f'Emote \:{emote.name}: successfully removed.') await context.send(fr'Emote \:{emote.name}: successfully removed.')
else: else:
for emote in (emote,) + emotes: for emote in (emote,) + emotes:
await context.invoke(self.remove, emote) await context.invoke(self.remove, emote)
@ -247,7 +247,7 @@ class Emotes(commands.Cog):
'An error occurred while renaming the emote:\n' 'An error occurred while renaming the emote:\n'
+ utils.format_http_exception(ex)) + utils.format_http_exception(ex))
await context.send(f'Emote successfully renamed to \:{new_name}:') await context.send(fr'Emote successfully renamed to \:{new_name}:')
@commands.command(aliases=('ls', 'dir')) @commands.command(aliases=('ls', 'dir'))
async def list(self, context, animated=''): async def list(self, context, animated=''):
@ -274,7 +274,7 @@ class Emotes(commands.Cog):
processed = [] processed = []
for emote in emotes: for emote in emotes:
raw = str(emote).replace(':', '\:') raw = str(emote).replace(':', r'\:')
processed.append(f'{emote} {raw}') processed.append(f'{emote} {raw}')
paginator = ListPaginator(context, processed) paginator = ListPaginator(context, processed)
@ -302,7 +302,7 @@ class Emotes(commands.Cog):
message = ['Multiple emotes were found with that name. Which one do you mean?'] message = ['Multiple emotes were found with that name. Which one do you mean?']
for i, emote in enumerate(candidates, 1): for i, emote in enumerate(candidates, 1):
message.append(f'{i}. {emote} (\:{emote.name}:)') message.append(fr'{i}. {emote} (\:{emote.name}:)')
await context.send('\n'.join(message)) await context.send('\n'.join(message))