zaanposni / discord-masz

MASZ is a selfhostable highly sophisticated moderation bot for Discord. Includes a web dashboard and a discord bot.
https://discord.gg/5zjpzw6h3S
Other
71 stars 18 forks source link

fix: 559 discord resources whitelisted in automod #561

Closed Simply-Cods closed 1 year ago

Simply-Cods commented 1 year ago

559

I added a regex matching all discord.com links not containing "/invite". All matches from _inviteRegex are compared against the whitelist, and if a match is made the link is skipped.

The commented out regex works as well and is much more restrictive, therefore it could be safer, but also it is way too long. Although if it ends up being a better solution it's ready to be uncommented.

The 2 deleted messages in the screenshot below were invite links (both discord.gg and discord.com/invite) image

zaanposni commented 1 year ago

Hi @Simply-Cods

thanks for your contribution. The current regex looks fine. The longer one would need be properly maintained so I feel like your solution is the right way to go.

One small thing: Please change your PR to the current release branch v3.3.0 Then I can include your fix correctly in the upcoming release and mention you in the patchnotes (if you want to)

Edit: There seems to be an error in my CI pipeline, I will merge it in the release branch and fix it there ^.^