ZeppelinBot / Zeppelin

Zeppelin is a moderation bot for Discord, designed with large servers and reliability in mind.
https://zeppelin.gg/
Other
393 stars 195 forks source link

Make getInviteCodesInString check codes with only 8 chars #478

Closed StanByes closed 5 months ago

StanByes commented 6 months ago

When we're using the match_invite rule, the bot, in its regex, check a code without any limit but all Discord invites have 8 characters. So, to avoid a member who has added a random char at the end of the link, by accident, take a sanction, I added a limit directly in all RegEx and in a substring for the part who works with the URL split.

cla-bot[bot] commented 6 months ago

Thank you for contributing to Zeppelin! We require contributors to sign our Contributor License Agreement (CLA). To let us review and merge your code, please visit https://github.com/ZeppelinBot/CLA to sign the CLA!

iamshoXy commented 6 months ago

Invites can have up to 10 characters and this would also break custom invite links

StanByes commented 6 months ago

I didn't think this, I'll try to modulate it Maybe with an optional parameter in the match_invite rule to limit the char length ? Any idea ? Because, in our case, we have many member who take a sanction because they added, accidentally, a character at the end of or link

rubyowo commented 6 months ago

That's pointless, you should just unwarn them manually, or just clean the message instead of warning entirely.