LuckPerms / clippy

A (very) helpful office assistant for the LuckPerms Discord.
https://discord.gg/luckperms
MIT License
11 stars 23 forks source link

Add crosspost detection #75

Open codingJWilliams opened 1 year ago

codingJWilliams commented 1 year ago

A cache of the most recent 10 (configurable) messages is stored in an array. When a user posts their message content is compared to this cache and if they have posted an identical message in a different channel, the bot will reply linking to the original message.

The idea of this is so that for those trying to help a Luckperms user, effort isn't duplicated by two people simeultaneously helping the same person across two channels.

Only messages that are over 50 characters and that are sent to a channel defined in the .env file are counted. This is to ensure that small messages like "ok" and "hi" etc aren't warned for crossposting, only large help messages etc. Empty messages (IE images, embeds, etc) are also included.

Any thoughts welcome :)