add sanity check for smart punctuation
This commit is contained in:
parent
7ecf14be46
commit
ad8f9ea77a
1 changed files with 12 additions and 0 deletions
|
@ -287,6 +287,18 @@ class Notifications(Cog):
|
|||
elif not to_clear:
|
||||
return await ctx.send("Canceled", delete_after=10)
|
||||
|
||||
if any(c in keyword for c in ["“", "”", "‘", "’"]):
|
||||
to_clear = await confirm(
|
||||
ctx,
|
||||
"Are you sure you want to add a keyword containing smart punctuation (aka fancy quotes)? (Reply with yes/no)\n**Note:** Smart punctuation **will frequently prevent keywords from working**.\nIf you are on an Apple device, go to your keyboard settings and disable 'Smart Punctuation'.",
|
||||
True,
|
||||
)
|
||||
|
||||
if to_clear is None:
|
||||
return await ctx.send("Timed out or received an invalid response", delete_after=10)
|
||||
elif not to_clear:
|
||||
return await ctx.send("Canceled", delete_after=10)
|
||||
|
||||
await self.add_keyword(ctx.guild.id, ctx.author.id, keyword, False)
|
||||
except KeywordError as e:
|
||||
await e.send(ctx)
|
||||
|
|
Loading…
Add table
Reference in a new issue