Closed B0tis closed 1 year ago
Are you wanting to know if there is a way to rate limit buttons or commands ?
For Buttons, it would be nice to know, for Commands it's already possible
I know something for commands already exists, It's just the way you phrased your message was a bit all over the place.
Why would you need a rate limit for buttons ? In some way discord makes you wait a bit before each button press anyways.
Well, I would like to have the possibility that the User can only use the Button once every Minute...
Have you tried using RateLimit
on a button since if I remember correctly button has a interaction parameter which is what RateLimit
uses ?
edit: I'm going to give it a try now.
Yup, RateLimit
works on buttons.
could you send me a Screenshot how you did that, i just get an error lol
I already deleted the temp project I did it in but all's I did was:
@ButtonComponent({ id: "hello-btn" })
@Guard(
RateLimit(TIME_UNIT.seconds, 30, {
message: "Please wait `30` seconds!",
})
)
helloBtn(interaction: ButtonInteraction): void {
interaction.reply(`👋 ${interaction.member}`);
}
ahhh lol, thx forgot the @Guards xD
Feature?
Hi, currently it is possible to Rate Limit the usage of commands but not from Button Interactions.
It would be nice that this Feature would be added if possible :)
Package
@discordx/utilities