mirror of
https://github.com/watn3y/steamsalty.git
synced 2025-06-07 15:21:00 +02:00
v0.3
Some checks failed
Build and Push to Docker Hub on changes to master branch / docker (push) Has been cancelled
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:
parent
9c64a3e4b5
commit
453f03d832
5 changed files with 98 additions and 7 deletions
|
@ -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
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue