Shift-Cyber / bits

Humanoid Discord bot with too much power and a bit of an attitude...
GNU General Public License v3.0
2 stars 0 forks source link

Develop Message Monitoring Service, Prevents PII Leaks and Offers Command Suggestions #26

Open natesinger opened 1 year ago

natesinger commented 1 year ago

We want to have a feature that monitors all messages in the server. If a command is sent in the server, not only remove it but also if a bad command was sent that is close, provide command suggestion and ensure that commands are sent in DMs. We also need to consider that some folks have DMs turned off and will have to have verbosity for that edge case.

Features

Valkerse commented 1 year ago

There is a new command format called "application commands" or "slash commands" that we should consider migrating to. It can interact with the user as they are typing in order to provide suggestions, corrections, and syntax. However, these types of commands do not work in DMs, so this may not work for us as bits currently functions largely in DMs

Valkerse commented 1 year ago

It is possible to have Bits simply delete the message in the public chat but then DM the user itself so that other users generally won't see it at all and the user doesn't have to change anything, just reply to the DM Could potentially be accomplished by changing "ctx.send"s to "ctx.author.send" OR "user.send"

natesinger commented 1 year ago

This definitely sounds worth investigating, good stuff.

On the topic of posting in public channels and removing, I don't love this idea because if you fat finger a command or just in general if the bot messes up, we end up leaving data. Or technically someone could scrape with the api and leak stuff regarless cause they'd get every message.

natesinger commented 1 year ago

Cherrypicked for Bits Release v1.1.0: Minor

Reginald-Gillespie commented 1 year ago

I don't recommend having the bot delete a slash command fast, a self-bot could still pick up pii like you said. There is actually a way to send input slash commands using something called modals, where the input will not be visible to other users even if the response is in public channels. You can space out the input and label each field like a form. It's newer so there's not as many tutorials on it. I don't do discord.py but I believe this is the relevant docs: https://discordpy.readthedocs.io/en/stable/interactions/api.html?highlight=modal#modal

natesinger commented 1 year ago

Nice, modals would be great but we still need to trigger it somehow, which would most likely happen through a slash command. Open to better ideas... we can of course automatically do the first on but idk after that.

Can leave a button in the dm with the bot but that sounds like a less pleasant UX, and i figure there will be commands we want people to be able to run in the future.