AndyReifman / ArseneWenger

1 stars 12 forks source link

Auto-delete discord invites #109

Closed AndyReifman closed 3 months ago

AndyReifman commented 3 months ago

The main purpose of this PR is to add code to the moderation cog moderation.py that checks if the message contains a discord invite, if so it deletes it. For the time being I'm deleting indiscriminately. At some point we could maybe adjust this to either have an allowlist or denylist. That said, I also added code to ignore the invite restriction if you're a mod.

In addition to that change I also updated the twitter_link_fixer.py to stop crashing if the message isn't a twitter link. Instead we catch the error and continue on.

Finally, I've started the process of switching from print statements to logging. As files are touched they should also be updated.