add option to set priority

This commit is contained in:
Jonas Leder 2024-01-05 11:30:22 +01:00
commit 8d810d62c0

View file

@ -6,6 +6,7 @@ import (
"net/http"
"net/url"
"os"
"strconv"
"github.com/gotify/go-api-client/v2/auth"
"github.com/gotify/go-api-client/v2/client"
@ -34,6 +35,10 @@ func getRoot(w http.ResponseWriter, r *http.Request) {
Message: string(messageContent),
}
if r.URL.Query().Has("priority") {
params.Body.Priority, _ = strconv.Atoi(r.URL.Query().Get("priority"))
}
_, err := gotifyClient.Message.CreateMessage(params, auth.TokenAuth(r.URL.Query().Get("token")))
if err != nil {