Fixed cooldown logic

This commit is contained in:
2024-01-03 11:39:43 -07:00
parent aa0e484dce
commit 6a30ccc662
4 changed files with 7 additions and 5 deletions

View File

@ -132,7 +132,7 @@ func (h *handler) cmdPing(ctx context.Context, data cmdroute.CommandData) *api.I
func (h *handler) cmdAsk(ctx context.Context, data cmdroute.CommandData) *api.InteractionResponseData {
// Cooldown Logic
allowed := lib.CooldownHandler(*data.Event)
allowed := lib.CooldownHandler(*data.Event, "ask", 1)
if !allowed {
return errorResponse(errors.New("please wait for the cooldown"))
@ -194,7 +194,7 @@ func (h *handler) cmdAsk(ctx context.Context, data cmdroute.CommandData) *api.In
func (h *handler) cmdPic(ctx context.Context, data cmdroute.CommandData) *api.InteractionResponseData {
// Cooldown Logic
allowed := lib.CooldownHandler(*data.Event)
allowed := lib.CooldownHandler(*data.Event, "pic", 1)
if !allowed {
return errorResponse(errors.New("please wait for the cooldown"))
@ -270,7 +270,7 @@ func (h *handler) cmdPic(ctx context.Context, data cmdroute.CommandData) *api.In
func (h *handler) cmdHDPic(ctx context.Context, data cmdroute.CommandData) *api.InteractionResponseData {
// Cooldown Logic
allowed := lib.CooldownHandler(*data.Event)
allowed := lib.CooldownHandler(*data.Event, "hdPic", 1)
if !allowed {
return errorResponse(errors.New("please wait for the cooldown"))