Compare commits
No commits in common. "77e66464b04644432c586cc1869fefacdc8ce792" and "a72316b1060840cc8fda0cb44256daa7fbe0c636" have entirely different histories.
77e66464b0
...
a72316b106
|
@ -2,7 +2,6 @@ package matrixbot
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"maunium.net/go/mautrix"
|
||||
"maunium.net/go/mautrix/event"
|
||||
|
@ -17,8 +16,7 @@ func SendMessage(roomID string, topic string, header string, content string, url
|
|||
client, err := mautrix.NewClient(cfg.HomeserverUrl, "", "")
|
||||
|
||||
if err != nil {
|
||||
log.Println("New client, err:", err.Error())
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
|
||||
_, err = client.Login(&mautrix.ReqLogin{
|
||||
|
@ -29,15 +27,10 @@ func SendMessage(roomID string, topic string, header string, content string, url
|
|||
})
|
||||
|
||||
if err != nil {
|
||||
log.Println("Client login, err:", err.Error())
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
|
||||
msg := format.RenderMarkdown(fmt.Sprintf("Thema: %s <h4>%s</h4>%s<br>%s", topic, header, content, url), false, true)
|
||||
|
||||
_, err = client.SendMessageEvent(id.RoomID(roomID), event.EventMessage, &msg)
|
||||
|
||||
if err != nil {
|
||||
log.Println("SendMessageEvent, err:", err.Error())
|
||||
}
|
||||
client.SendMessageEvent(id.RoomID(roomID), event.EventMessage, &msg)
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ func MelsungenNews() {
|
|||
matrixbot.SendMessage(config.Cfg.Pages[1].RoomID, "Melsungen - Aktuelles", postTitle, postExcerpt, postUrl)
|
||||
}
|
||||
|
||||
time.Sleep(10 * time.Second)
|
||||
time.Sleep(2 * time.Second)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue