From 9d23c3ef394bc8d266f9b6bd139abe6b76dd5e35 Mon Sep 17 00:00:00 2001 From: rxdn <29165304+rxdn@users.noreply.github.com> Date: Mon, 30 Aug 2021 21:59:11 +0100 Subject: [PATCH] Fix slash command creation --- .../api/whitelabel/whitelabelcreateinteractions.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/http/endpoints/api/whitelabel/whitelabelcreateinteractions.go b/app/http/endpoints/api/whitelabel/whitelabelcreateinteractions.go index 68d28cc..fb3a963 100644 --- a/app/http/endpoints/api/whitelabel/whitelabelcreateinteractions.go +++ b/app/http/endpoints/api/whitelabel/whitelabelcreateinteractions.go @@ -8,6 +8,7 @@ import ( "github.com/TicketsBot/worker/bot/command/impl/admin" "github.com/TicketsBot/worker/bot/command/manager" "github.com/gin-gonic/gin" + "github.com/rxdn/gdl/objects/interaction" "github.com/rxdn/gdl/rest" "time" ) @@ -48,7 +49,7 @@ func GetWhitelabelCreateInteractions() func(*gin.Context) { if err != nil { ctx.JSON(500, gin.H{ "success": false, - "error": err.Error(), + "error": err.Error(), }) return } @@ -59,14 +60,14 @@ func GetWhitelabelCreateInteractions() func(*gin.Context) { if err != nil { ctx.JSON(500, gin.H{ "success": false, - "error": err.Error(), + "error": err.Error(), }) return } ctx.JSON(400, gin.H{ "success": false, - "error": fmt.Sprintf("Interaction creation on cooldown, please wait another %d seconds", int64(expiration.Seconds())), + "error": fmt.Sprintf("Interaction creation on cooldown, please wait another %d seconds", int64(expiration.Seconds())), }) return @@ -76,7 +77,7 @@ func GetWhitelabelCreateInteractions() func(*gin.Context) { if err != nil { ctx.JSON(500, gin.H{ "success": false, - "error": err.Error(), + "error": err.Error(), }) return } @@ -95,6 +96,7 @@ func GetWhitelabelCreateInteractions() func(*gin.Context) { Name: option.Name, Description: option.Description, Options: option.Options, + Type: interaction.ApplicationCommandTypeChatInput, } interactions = append(interactions, data) @@ -107,7 +109,7 @@ func GetWhitelabelCreateInteractions() func(*gin.Context) { } else { ctx.JSON(500, gin.H{ "success": false, - "error": err.Error(), + "error": err.Error(), }) } }