fix webhooks
This commit is contained in:
parent
203bdd938b
commit
5b05e27bae
@ -178,7 +178,7 @@ func WebChatWs(ctx *gin.Context) {
|
|||||||
|
|
||||||
success := false
|
success := false
|
||||||
if webhook != nil {
|
if webhook != nil {
|
||||||
success = executeWebhook(content, ticket.Uuid, *webhook, store)
|
success = executeWebhook( ticket.Uuid, *webhook, content, store)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !success {
|
if !success {
|
||||||
@ -207,7 +207,7 @@ func executeWebhook(uuid, webhook, content string, store sessions.Session) bool
|
|||||||
encoded, err := json.Marshal(&body); if err != nil {
|
encoded, err := json.Marshal(&body); if err != nil {
|
||||||
return false
|
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
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user