Humblemonk / DiceMaiden

Dice bot for Discord
Apache License 2.0
117 stars 51 forks source link

Request: Don't delete roll prompts. (Or add setting to decide roll prompt handling behaviour.) #232

Closed OmegaMetroid closed 1 month ago

OmegaMetroid commented 3 months ago

The bot is currently designed to delete roll prompts, only preserving the messages as pseudo-reply targets, and seemingly has no option to change this behaviour. I would like to suggest that you either remove this behaviour and leave the prompts for all to see (ideally still replying to them), or add a configuration setting that allows users to decide whether they want prompts to be left alone or deleted on a per-server basis. It even deletes messages if its role permissions are set to disallow message management, which seems pretty suspect! (And also violates the principle of least astonishment.)

As it stands, this behaviour is annoying, and might technically be in violation of Discord's ToS. (On the grounds that it bypasses role permissions to perform unauthorised actions. I'm not sure if bots are allowed to do that, but any normal user that found a way to delete other users' messages without the appropriate role permission would probably be banned.) Other bots do it, I'm aware, but that doesn't mean you need to sink to their level. The ideal is probably to make it a configurable setting, with "don't delete anything" as a close second. Or if nothing else, maybe at least design the bot to respect role permissions? Discord acknowledges them on the bot's Integrations page, so the permissions are available for the bot to poll if need be.

Thanks for your time.

Humblemonk commented 3 months ago

Do you mean the deletion of roll prompts via the purge command? So the roll purge command does not bypass permissions. The user must have the "manage messages" or "administrator" role. Closing this as a won't do as this functionality has been in the bot since 2017.

OmegaMetroid commented 1 month ago

No, I mean how the bot automatically deletes your roll request when it "replies" to it, removing the message from the channel. If you send a message such as /r message:d20, then it removes the /r message:d20 message from the channel when it responds, instead changing it into a little "[user] used [message]" pseudo-reply. (This is evident if you then press the up arrow on your keyboard, while the cursor is in the message box. Normally, pressing up acts as an "edit last sent message" command, as in most messaging systems. However, if you roll a die, and then press up, Discord just copies your last message's text into the message box because the actual message itself no longer exists. Searching for the message also returns the rollbot's response, instead of your actual message.)

This DOES NOT have anything to do with the purge command; it's an annoying behaviour attached to the roll command, as I described. As mentioned, many other bots do this when they roll, gleefully breaking searches and message history in the process, but it should ideally be a configurable setting. And as stated, the bot also removes messages when it rolls regardless of its assigned permissions; even on my own private server, where Dice Maiden has every permission except View Channels and Send Messages disabled, it still removes messages that it explicitly does not have permission to remove. (Which, as I mentioned, may or may not be a violation of Discord's ToS, I'm honestly not sure. Emphasis added for clarification, not to represent anger; it is explicitly the roll command, not the purge command, which is the problem here.)

This issue was incorrectly closed, and the issue never addressed; I would appreciate it if you would re-open it so it can actually be solved.

Humblemonk commented 1 month ago

Ah I see. Well I dont think there's much I can do here as the issue at hand is how bots respond to slash command requests. I feel this is more on the discord than dice maiden with their API implementation. If you can provide me an example ill be more than happy to investigate

OmegaMetroid commented 1 month ago

Sorry for the delayed reply, was a bit busy. Here are a couple example pictures, DMing the bot to minimise variables.

Before Sending: image

After Sending: image image

Search Results: image image

As previously mentioned, pressing the Up Arrow in the message box doesn't automatically open the last message for editing, but instead copies its contents into the message box so it can be sent again, effectively functioning as a "history" option. It also seems to tag these messages as being from both the original sender (in this case me) and itself. I'm admittedly not too familiar with the Discord API, it's been quite a while since I last looked at it, and I didn't really do anything complex with it then; I assumed that it was a conscious choice on your end (and admittedly a perfectly viable one, just not one I'm particularly fond of myself), since I've seen other bots respond to roll prompts without replacing them, though it is possible that it might be an API wonk now that you mention it.

If it's on their end, don't sweat it, I don't think you can make them change it. If it's on your end, I would personally appreciate at least having a configuration option to choose between "replace prompt" and "reply to prompt", though the decision is of course up to you. Thanks for your time, I hope this is enough; if it's not, please give me more specific guidance on what sort of examples you need.

Humblemonk commented 1 month ago

Nope its all good. Thanks for the details! Ya this is completely outside of my control and a design decision by Discord for bots that utilize slash commands. Not much I can do here :(

OmegaMetroid commented 1 month ago

Ah. That's a shame; it's annoying, makes searching kinda wonky, and makes it harder to skim through a channel since you can't tell which user asked for the roll without taking the time to check. Thanks for checking, though, it's much appreciated.