diff --git a/internal/webhook_server.go b/internal/webhook_server.go index 91a6dfda..637b0ad3 100644 --- a/internal/webhook_server.go +++ b/internal/webhook_server.go @@ -90,13 +90,12 @@ func (h *webhookInteractionHandler) ServeHTTP(w http.ResponseWriter, r *http.Req w.WriteHeader(http.StatusBadRequest) } c := make(chan interface{}) - h.webhookServer.Disgo().EventManager().Handle(api.InteractionCreateWebhookEvent, rawBody, c) + go h.webhookServer.Disgo().EventManager().Handle(api.InteractionCreateWebhookEvent, rawBody, c) - response := <-c w.WriteHeader(http.StatusOK) w.Header().Set("Content-Type", "application/json") - err = json.NewEncoder(w).Encode(response) + err = json.NewEncoder(w).Encode(<-c) if err != nil { log.Errorf("error writing body: %s", err) }