mirror of
https://github.com/idanoo/go-mastodon-matrix-webhooks.git
synced 2024-11-26 02:15:17 +00:00
Updates
This commit is contained in:
parent
9cc5fec58f
commit
66468545ba
4
main.go
4
main.go
@ -43,7 +43,7 @@ func init() {
|
|||||||
log.Fatal("PORT empty or invalid")
|
log.Fatal("PORT empty or invalid")
|
||||||
}
|
}
|
||||||
|
|
||||||
IP2LOCATION_FILE = os.Getenv("IP2LOCATION_API_KEY")
|
IP2LOCATION_FILE = os.Getenv("IP2LOCATION_FILE")
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -71,7 +71,7 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
} else if i.Event == "account.created" {
|
} else if i.Event == "account.created" {
|
||||||
country := ipLookup(i.Object.IP)
|
country := ipLookup(i.Object.IP)
|
||||||
err = sendWebhook(fmt.Sprintf("*New Signup* %s has signed up.%s", i.Object.Username, country))
|
err = sendWebhook(fmt.Sprintf("*New Signup* %s (%s) has signed up.%s", i.Object.Username, i.Object.Email, country))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err.Error())
|
log.Println(err.Error())
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user