Add notes!

This commit is contained in:
idanoo 2022-11-20 18:38:00 +13:00
parent cba0345278
commit 35d2e29f5f
Signed by: idanoo
GPG Key ID: 387387CDBC02F132
2 changed files with 8 additions and 3 deletions

10
main.go
View File

@ -74,10 +74,14 @@ func handler(w http.ResponseWriter, r *http.Request) {
country := ipLookup(i.Object.IP)
err = sendWebhook(
fmt.Sprintf(
"*New Signup* %s (%s) has signed up.%s\n%s",
"New Signup%s: %s (%s) has signed up.\n%s\n%s",
country,
i.Object.Username,
i.Object.Email,
country,
fmt.Sprintf(
"Notes: %s",
i.Object.Notes,
),
fmt.Sprintf(
"https://mastodon.nz/admin/accounts/%s",
i.Object.ID,
@ -140,5 +144,5 @@ func ipLookup(ip string) string {
return ""
}
return " (" + results.Country_long + ")"
return " from" + results.Country_long
}

View File

@ -14,6 +14,7 @@ type MastodonEvent struct {
Username string `json:"username"`
Email string `json:"email"`
IP string `json:"ip"`
Notes string `json:"invite_request"`
TargetAccount struct {
ID string `json:"id"`
Username string `json:"username"`