add option to set priority
This commit is contained in:
parent
959227b0af
commit
8d810d62c0
1 changed files with 5 additions and 0 deletions
5
main.go
5
main.go
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue