v0.3
Some checks failed
Build and Push to Docker Hub on changes to master branch / docker (push) Has been cancelled

- added start command
- added info command
This commit is contained in:
Noah 2024-12-21 08:28:28 +01:00
parent 9c64a3e4b5
commit 453f03d832
5 changed files with 98 additions and 7 deletions

View file

@ -6,7 +6,7 @@ import (
"watn3y/steamsalty/config"
)
func Authenticate() *tgbotapi.BotAPI {
func Authenticate() (tgbotapi.UpdatesChannel, *tgbotapi.BotAPI) {
bot, err := tgbotapi.NewBotAPI(config.BotConfig.TelegramAPIToken)
if err != nil {
log.Panic().Err(err).Msg("Failed to authenticate")
@ -14,7 +14,11 @@ func Authenticate() *tgbotapi.BotAPI {
bot.Debug = config.BotConfig.DebugMode
updates := tgbotapi.NewUpdate(0)
updates.Timeout = 60
log.Info().Int64("ID", bot.Self.ID).Str("username", bot.Self.UserName).Msg("Successfully authenticated to Telegram API")
return bot
return bot.GetUpdatesChan(updates), bot
}