mirror of
https://github.com/watn3y/steamsalty.git
synced 2025-09-09 17:42:24 +02:00
v0.1
This commit is contained in:
parent
6aa64b6287
commit
3ec330e3a2
16 changed files with 408 additions and 1 deletions
20
botIO/authenticate.go
Normal file
20
botIO/authenticate.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package botIO
|
||||
|
||||
import (
|
||||
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
|
||||
"github.com/rs/zerolog/log"
|
||||
"watn3y/steamsalty/config"
|
||||
)
|
||||
|
||||
func Authenticate() *tgbotapi.BotAPI {
|
||||
bot, err := tgbotapi.NewBotAPI(config.BotConfig.TelegramAPIToken)
|
||||
if err != nil {
|
||||
log.Panic().Err(err).Msg("Failed to authenticate")
|
||||
}
|
||||
|
||||
bot.Debug = config.BotConfig.DebugMode
|
||||
|
||||
log.Info().Int64("ID", bot.Self.ID).Str("username", bot.Self.UserName).Msg("Successfully authenticated to Telegram API")
|
||||
|
||||
return bot
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue