summaryrefslogtreecommitdiff
path: root/flatbot.go
diff options
context:
space:
mode:
Diffstat (limited to 'flatbot.go')
-rw-r--r--flatbot.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/flatbot.go b/flatbot.go
index 3cb052f..fc565f7 100644
--- a/flatbot.go
+++ b/flatbot.go
@@ -5,6 +5,7 @@ import (
"io"
"log"
"net/http"
+ "os"
)
func main() {
@@ -22,6 +23,18 @@ func main() {
log.Fatal(err)
}
flats = removeAlreadySent(flats, sent)
+ m := messenger{
+ Token: os.Getenv("FLATBOT_TELEGRAM_BOT_API_TOKEN"),
+ ChatID: os.Getenv("FLATBOT_TELEGRAM_CHANNEL_ID"),
+ }
+ for _, f := range flats {
+ err = m.Send(f)
+ if err != nil {
+ // TODO: what to do with it?
+ log.Print(err)
+ }
+ sent = append(sent, f)
+ }
fmt.Println(flats)
writeSent(flats, "/tmp/sent.json")
}