heruvym/internal/initialize/tg.go

22 lines
349 B
Go
Raw Normal View History

2024-09-25 14:22:57 +00:00
package initialize
import (
tb "gopkg.in/tucnak/telebot.v2"
"time"
)
func NewTgBot(cfg Config) (*tb.Bot, error) {
newBot, err := tb.NewBot(tb.Settings{
Token: cfg.TgToken,
Verbose: false,
ParseMode: tb.ModeHTML,
Poller: &tb.LongPoller{
Timeout: time.Second,
},
})
if err != nil {
return nil, err
}
return newBot, nil
}