Website/telegram.go
partisan 63c04a9b44 wip
2024-08-14 12:43:07 +02:00

26 lines
455 B
Go

package main
import (
"log"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
)
func startTelegramBot() {
u := tgbotapi.NewUpdate(0)
u.Timeout = 60
updates := bot.GetUpdatesChan(u)
for update := range updates {
if update.Message == nil {
continue
}
msg := tgbotapi.NewMessage(update.Message.Chat.ID, update.Message.Text)
_, err := bot.Send(msg)
if err != nil {
log.Printf("Error sending message: %v", err)
}
}
}