diff options
author | Dmitry Ilvokhin <d@ilvokhin.com> | 2025-03-03 21:31:10 +0000 |
---|---|---|
committer | Dmitry Ilvokhin <d@ilvokhin.com> | 2025-03-03 21:31:10 +0000 |
commit | 547a44a9fb502a308f596e6ffe1a90bd6c4607bc (patch) | |
tree | ae20f6fbcf0689569bec5b6ae018a01271abdce1 /flatbot.go | |
parent | 96bcc15d6e3e820309c874fe39df11cb88b30af2 (diff) | |
download | flatbot-547a44a9fb502a308f596e6ffe1a90bd6c4607bc.tar.gz flatbot-547a44a9fb502a308f596e6ffe1a90bd6c4607bc.tar.bz2 flatbot-547a44a9fb502a308f596e6ffe1a90bd6c4607bc.zip |
Send message to Telegram
Diffstat (limited to 'flatbot.go')
-rw-r--r-- | flatbot.go | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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") } |