move config parsing into a separate module, fix project name

This commit is contained in:
Von Random 2025-02-09 16:06:39 +02:00
parent 0ab510adef
commit d6d8b1a9a6
4 changed files with 46 additions and 25 deletions

15
main.go
View file

@ -2,18 +2,25 @@ package main
import (
"log"
"os"
"time"
"mechanus.net/pgobot/matcher"
"mechanus.net/pgobot/responder"
"mechanus.net/pgbot/config"
"mechanus.net/pgbot/matcher"
"mechanus.net/pgbot/responder"
"gopkg.in/telebot.v4"
)
type ConfigSpec struct {
Token string `yaml:"token"`
}
func main() {
var conf ConfigSpec
config.Parse("config.yml", &conf)
pref := telebot.Settings{
Token: os.Getenv("TOKEN"),
Token: conf.Token,
Poller: &telebot.LongPoller{Timeout: 10 * time.Second},
}