goopypanther / saucebot-discord

17 stars 13 forks source link

Fix condition for disabling preview activating when mentioning users/etc #5

Closed Delphox closed 5 years ago

Delphox commented 5 years ago

The condition to disable the bot previews checks if angular brackets meet anywhere in the message, which ends up capturing mentions towards other users, roles, channels, or if custom emojis/animated nitro emojis are present anywhere in the message, as they respectively appear as <@user_id>, <@&role_id>, <#channel_id>, <:emoji_id:> and <a:animated_emoji_id:> in the message.content, all with meeting angular brackets.

I've changed disable_command_pattern to prevent returning a match if the character after the first bracket match any of the scenarios presented above. I don't have a running instance of the bot though so I haven't tested if it works but it should.