#Cooldown

1 messages · Page 1 of 1 (latest)

blazing stump
#

When I set a command cooldown it doesn't seem to send a error message?

midnight irisBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

coral frost
blazing stump
#

I checked that but wasn't sure if it's command denied

#

Nothing gets printed when trying to log

#

I can post code when home

coral frost
#

please do

blazing stump
#
export class ChatInputCommandDenied extends Listener<typeof Events.ChatInputCommandDenied> {
    public run(error: UserError, { interaction }: ChatInputCommandDeniedPayload) {
        console.log(error)
        console.log(interaction)
        // ...
    }
}
#

and I am using a slash command with ```ts
public constructor(context: Command.Context) {
super(context, {
cooldownDelay: Time.Second * 5,
cooldownScope: BucketScope.User
});
}

coral frost
#

name of the listener file?

#

and did you rebuild ts?

blazing stump
#

Cooldown.ts

#

yeah I did I can try clear it

stoic pond
#

Or you can add { event: Events.ChatInputCommandDenied } to the constructor

blazing stump
#

ahh I see, I missed that completely :S do you have an example for the constructor what I need inside it?

#

It's printing now so I can debug it and figure out the rest

#

thank you so much both of you two

coral frost
blazing stump
#

oh I see

#

So to sum it up listeners needs the actual name of the listener exactly otherwise overriden in constructor, while preconditions can have any name

#

Either way I will read the guide more as it's very well-written and I missed a few things on it so thanks again!