No767 / Kumiko

A multipurpose Discord bot built with freedom and choice in mind
https://kumiko.readthedocs.io/en/latest/
Apache License 2.0
20 stars 5 forks source link

[Task] Anti-Ping / DND system #460

Closed No767 closed 11 months ago

No767 commented 1 year ago

Task Description

This idea isn't mine, but I will make a take on it for Kumiko. This will be the feature that should convince the ddevs to allow message_content for my bot.

To prevent excess mentions and pings if someone is AFK (or on DND), there is a step on how this works:

  1. Within the on_message event, just like how R. Danny does it, check if the user is the bot, return if so, and then process the message
  2. Check cache (either on Redis or in-memory) to see the user has dnd turned on within the system. If the user is not within cache (they should), add it from the DB and then add to cache.
    • If so, escape the mention (exclude @everyone or @here mentions bc other bots will either do this or it is disabled) of the user, and throw back a reply at the mention saying that the user is on DND and display an embed for it (customizable)
    • If not, return the func and stop processing
  3. If the user has speficied they want to ignore the system on a guild, then let that pass and the mention go through.

Now this is a global system where if an user is on DND, that it effectively gets muted. Now in addition to this, we can keep a list of pings (within database), and optionally the user has the option of wiping the pings from the db as well.

The pings would be deleted from the database when the user completes the sesssion.

Now the way it works is each time you turn this system on, you essentially make a dnd session. Each session is generated via a unique UUID, which that is generated by postgres. This way, when there is a ping, it will be stored and then wiped once done

Now here is the stuff that needs to be done:

No767 commented 11 months ago

This is one of those issues where I am shoving in more stuff but in reality it's not needed. The rationale is described below:

  1. Kumiko has already a ton of features. Adding more features preemptively without a sturdy base will cause issues. The existing codebase is undergoing a complete redesign, as most major parts such as the economy system and pins are getting a massive facelift for the nth time.
  2. Adding more features is just going to stress me out even further. It's going to put a strain on the existing codebase and break.

Although an interesting idea, I want to revisit this in the future instead of now