Fix quote reorganization

This commit is contained in:
2021-01-27 16:27:00 +01:00
parent 8b56942cf3
commit 3453d155d8

6
bot.py
View File

@@ -267,10 +267,10 @@ async def quote_command(ctx: commands.Context, author: Optional[str], *, quote:
quote = quote[0].upper() + quote[1::]
if author in quotes:
author_quotes: List[str] = quotes[author]
regex = re.compile(r'[\W]')
stripped_quote = regex.sub(quote, '').lower()
regex = re.compile(r'\W')
stripped_quote = regex.sub('', quote).lower()
for aq in author_quotes:
if regex.sub(aq, '').lower() == stripped_quote:
if regex.sub('', aq).lower() == stripped_quote:
await ctx.channel.send("Quote already exists!")
return