mirror of
https://github.com/watn3y/steamsalty.git
synced 2025-09-09 09:42:22 +02:00
v0.3
- added start command - added info command
This commit is contained in:
parent
4d83372270
commit
f3459a6ce2
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