Made cooldowns a bit more intuitive

This commit is contained in:
2024-01-10 00:56:36 -07:00
parent bba02f0303
commit b3e6291ad6
3 changed files with 16 additions and 14 deletions

10
main.go
View File

@ -29,7 +29,7 @@ var commands = []api.CreateCommandData{
},
{
Name: "ask",
Description: "Ask Himbot! Cooldown: 1 Minute.",
Description: "Ask Himbot! Cooldown: 2 Minutes.",
Options: []discord.CommandOption{
&discord.StringOption{
OptionName: "prompt",
@ -118,10 +118,10 @@ 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, "ask", time.Minute)
allowed, cooldownString := lib.CooldownHandler(*data.Event, "ask", time.Minute)
if !allowed {
return errorResponse(errors.New("please wait for the cooldown"))
return errorResponse(errors.New(cooldownString))
}
// Command Logic
@ -167,10 +167,10 @@ 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, "pic", time.Minute)
allowed, cooldownString := lib.CooldownHandler(*data.Event, "pic", time.Minute*2)
if !allowed {
return errorResponse(errors.New("please wait for the cooldown"))
return errorResponse(errors.New(cooldownString))
}
// Command Logic