Closed TyladYT closed 9 months ago
Wouldn't this be better to be an option a server owner can set instead of being hard coded (and being forced on)?
This sounds like a nice thing to add but there are a few small issues with this implementation:
channelId + ":" + autoResponseId
as the key for the setI think the timeout should apply per channel AND per auto response. This could be achieved by using channelId + ":" + autoResponseId as the key for the set
I kind of disagree, because if you have multiple tickets and such with different staff members handling different tickets, or just overall a lot of tickets, this could be annoying (forced, at least)
The point was that you can use different auto responses at the same time or the same auto response in different channels at the same time.
Look at the implementation example
- I think the timeout should apply per channel AND per auto response. This could be achieved by using
channelId + ":" + autoResponseId
as the key for the set
I completely agree with how it should be based per-channel AND per-autoresponse, this would enforce cooldowns a lot better since then people won't have to wait the cooldown out if another user has used the same tag/autoresponse in the other channel. I will implement this suggestion into my ModBot instance, and continue testing.
- I don't think reacting to the message is necessary if the response is under cooldown.
I think a reaction is necessary, due to letting the user know that a cooldown is currently active. It would make things much easier and simple to apply to the user's mind, letting them know "Hey, a cooldown is currently in place" without actually sending a message, because atm in my opinion ModBot is just messages everywhere right now. Adding a reaction would ease things up a bit in this aspect, if you get what I mean? At one time, Minehut used a cooldown emoji for their bot, the same timer one I used in this code snippet. It worked as a fantastic solution rather than replying to the message and then deleting the reply. Plus, you can't reply to messages in ephemeral responses meaning it would be pretty pointless to reply with a cooldown message if it's not ephemeral. Nobody needs to see a "This command is on cooldown" message or whatever, a reaction fits just perfectly.
Feel free to ask me questions, I can elaborate at any time if you like.
Autoresponses are not always commands and if the bot reacts to your message with an emoji, and you don't know that it would usually have responded to that message, that might be confusing.
I think it would generally be a good thing to implement a real "tag" system that uses slash commands for your use case. This could use an ephemeral response when the tag is on "timeout" while also removing the message before it, providing autocompletion etc.
This modification adds a cooldown per auto-response (tags) per-channel to make sure that if multiple people execute a tag all at once, then the bot doesn't send it twice. It'll only respond to one tag. E.G. If a user asks, "how do I appeal?", then four people execute !appeal to show the user what to do, that message is sent 4 times. But with this modification, the bot only replies to one, and reacts with the timer emoji for the rest.