diff --git a/main.go b/main.go index 91ce3ed..fe64e49 100644 --- a/main.go +++ b/main.go @@ -65,7 +65,21 @@ func handler(w http.ResponseWriter, r *http.Request) { } if i.Event == "report.created" { - err = sendWebhook("New report!") + err = sendWebhook( + fmt.Sprintf( + "[New Report](%s): %s has reported %s for %s", + fmt.Sprintf( + "https://mastodon.nz/admin/reports/%s", + i.Object.ID, + ), + i.Object.Account.Username, + i.Object.TargetAccount.Username, + fmt.Sprintf( + "Comments: %s", + i.Object.Comment, + ), + ), + ) if err != nil { log.Println(err.Error()) return diff --git a/structs.go b/structs.go index 59e49c3..9d0d984 100644 --- a/structs.go +++ b/structs.go @@ -10,11 +10,17 @@ type MatrixWebhook struct { type MastodonEvent struct { Event string `json:"event"` Object struct { - ID string `json:"id"` - Username string `json:"username"` - Email string `json:"email"` - IP string `json:"ip"` - Notes string `json:"invite_request"` + ID string `json:"id"` + Username string `json:"username"` + Email string `json:"email"` + IP string `json:"ip"` + Notes string `json:"invite_request"` + Comment string `json:"comment"` + Account struct { + ID string `json:"id"` + Username string `json:"username"` + Domain interface{} `json:"domain"` + } `json:"account"` TargetAccount struct { ID string `json:"id"` Username string `json:"username"`