mirror of
https://github.com/idanoo/go-mastodon-matrix-webhooks.git
synced 2024-11-22 08:25:17 +00:00
Increate formatting
This commit is contained in:
parent
fc1a9882f9
commit
57c8293e87
7
main.go
7
main.go
@ -74,7 +74,7 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
||||
country := ipLookup(i.Object.IP)
|
||||
err = sendWebhook(
|
||||
fmt.Sprintf(
|
||||
"New Signup%s: %s (%s) has signed up.\n%s\n%s",
|
||||
"New Signup%s: %s (%s). %s. %s",
|
||||
country,
|
||||
i.Object.Username,
|
||||
i.Object.Email,
|
||||
@ -98,8 +98,7 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// sendWebhook - takes msg, sends to matrix
|
||||
func sendWebhook(msgText string) error {
|
||||
log.Println(msgText)
|
||||
|
||||
// log.Println(msgText)
|
||||
data := MatrixWebhook{
|
||||
Key: MATRIX_WEBHOOK_API_KEY,
|
||||
}
|
||||
@ -109,7 +108,7 @@ func sendWebhook(msgText string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Printf("Sending %s to %s", b, MATRIX_WEBHOOK_URL+"/"+MATRIX_CHANNEL)
|
||||
// log.Printf("Sending %s to %s", b, MATRIX_WEBHOOK_URL+"/"+MATRIX_CHANNEL)
|
||||
req, err := http.NewRequest("POST", MATRIX_WEBHOOK_URL+"/"+MATRIX_CHANNEL, bytes.NewBuffer(b))
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user