From 86ddac016748775a824d1a4d44254bc51d6f08a4 Mon Sep 17 00:00:00 2001 From: Dot-Rar Date: Thu, 5 Mar 2020 15:01:48 +0000 Subject: [PATCH] use the right import --- app/http/endpoints/manage/webchatws.go | 9 ++++----- cmd/panel/main.go | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/http/endpoints/manage/webchatws.go b/app/http/endpoints/manage/webchatws.go index 677a9df..33b7a3e 100644 --- a/app/http/endpoints/manage/webchatws.go +++ b/app/http/endpoints/manage/webchatws.go @@ -9,7 +9,6 @@ import ( "github.com/TicketsBot/GoPanel/utils/discord/endpoints/channel" "github.com/TicketsBot/GoPanel/utils/discord/endpoints/webhooks" "github.com/TicketsBot/GoPanel/utils/discord/objects" - "github.com/TicketsBot/TicketsGo/database" "github.com/gin-gonic/contrib/sessions" "github.com/gin-gonic/gin" "github.com/gorilla/websocket" @@ -171,7 +170,7 @@ func WebChatWs(ctx *gin.Context) { // Preferably send via a webhook webhookChan := make(chan *string) - go database.GetWebhookByUuid(ticket.Uuid, webhookChan) + go table.GetWebhookByUuid(ticket.Uuid, webhookChan) webhook := <-webhookChan success := false @@ -191,10 +190,10 @@ func WebChatWs(ctx *gin.Context) { }, nil, &resChan) res := <-resChan - if res.StatusCode == 200 { - success = true + if res.StatusCode == 404 || res.StatusCode == 403 { + go table.DeleteWebhookByUuid(ticket.Uuid) } else { - go database.DeleteWebhookByUuid(ticket.Uuid) + success = true } } diff --git a/cmd/panel/main.go b/cmd/panel/main.go index acde42e..7f99e21 100644 --- a/cmd/panel/main.go +++ b/cmd/panel/main.go @@ -10,7 +10,7 @@ import ( "github.com/TicketsBot/GoPanel/config" "github.com/TicketsBot/GoPanel/database" "github.com/TicketsBot/GoPanel/utils" - "github.com/TicketsBot/TicketsGo/sentry" + "github.com/apex/log" "math/rand" "time" ) @@ -21,7 +21,7 @@ func main() { if err == nil { rand.Seed(int64(binary.LittleEndian.Uint64(b[:]))) } else { - sentry.Error(err) + log.Error(err.Error()) rand.Seed(time.Now().UnixNano()) }