initial prototype, only responds with tokens

This commit is contained in:
Von Random 2025-02-09 14:29:04 +02:00
parent d2fd718f22
commit 0ab510adef
5 changed files with 128 additions and 0 deletions

31
main.go Normal file
View file

@ -0,0 +1,31 @@
package main
import (
"log"
"os"
"time"
"mechanus.net/pgobot/matcher"
"mechanus.net/pgobot/responder"
"gopkg.in/telebot.v4"
)
func main() {
pref := telebot.Settings{
Token: os.Getenv("TOKEN"),
Poller: &telebot.LongPoller{Timeout: 10 * time.Second},
}
tokenMatcher := matcher.InitMatcher("tokens.yml")
bot, err := telebot.NewBot(pref)
if err != nil {
log.Fatal(err)
return
}
responder.InitResponder(bot, tokenMatcher)
bot.Start()
}