From 5b05e27bae50bf256e150a2148657ed5d848f887 Mon Sep 17 00:00:00 2001 From: Dot-Rar Date: Fri, 6 Mar 2020 19:37:58 +0000 Subject: [PATCH] fix webhooks --- app/http/endpoints/manage/webchatws.go | 4 ++-- database/table/ticketwebhook.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/http/endpoints/manage/webchatws.go b/app/http/endpoints/manage/webchatws.go index 7db764c..cae00ed 100644 --- a/app/http/endpoints/manage/webchatws.go +++ b/app/http/endpoints/manage/webchatws.go @@ -178,7 +178,7 @@ func WebChatWs(ctx *gin.Context) { success := false if webhook != nil { - success = executeWebhook(content, ticket.Uuid, *webhook, store) + success = executeWebhook( ticket.Uuid, *webhook, content, store) } if !success { @@ -207,7 +207,7 @@ func executeWebhook(uuid, webhook, content string, store sessions.Session) bool encoded, err := json.Marshal(&body); if err != nil { return false } - req, err := http.NewRequest("POST", fmt.Sprintf("https://discordapp.com/api/v6/webhooks/%s", webhook), bytes.NewBuffer(encoded)); if err != nil { + req, err := http.NewRequest("POST", fmt.Sprintf("https://canary.discordapp.com/api/webhooks/%s", webhook), bytes.NewBuffer(encoded)); if err != nil { return false } diff --git a/database/table/ticketwebhook.go b/database/table/ticketwebhook.go index fa5a18e..bfce1ed 100644 --- a/database/table/ticketwebhook.go +++ b/database/table/ticketwebhook.go @@ -3,8 +3,8 @@ package table import "github.com/TicketsBot/GoPanel/database" type TicketWebhook struct { - Uuid string `gorm:"column:UUID;type:varchar(36);unique;primary_key"` - WebhookUrl string `gorm:"column:CDNURL;type:varchar(200)"` + Uuid string `gorm:"column:UUID;type:varchar(36);unique;primary_key"` + WebhookUrl string `gorm:"column:CDNURL;type:varchar(200)"` } func (TicketWebhook) TableName() string {