mirror of
https://github.com/idanoo/go-mastodon-matrix-webhooks.git
synced 2024-11-21 16:11:58 +00:00
Add notes!
This commit is contained in:
parent
cba0345278
commit
35d2e29f5f
10
main.go
10
main.go
@ -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
|
||||
}
|
||||
|
@ -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"`
|
||||
|
Loading…
Reference in New Issue
Block a user