diff options
author | terminaldweller <devi@terminaldweller.com> | 2023-12-04 22:52:15 +0000 |
---|---|---|
committer | terminaldweller <devi@terminaldweller.com> | 2023-12-04 22:52:15 +0000 |
commit | f5d387b1be2ad859023e8c66fc7ce04889e6e69d (patch) | |
tree | f99a0613b7f107d085d0246a8056e79442d3c64f /telebot/telebot.go | |
parent | removed goproxy (diff) | |
download | hived-f5d387b1be2ad859023e8c66fc7ce04889e6e69d.tar.gz hived-f5d387b1be2ad859023e8c66fc7ce04889e6e69d.zip |
temp fix for the telebot crash
Diffstat (limited to 'telebot/telebot.go')
-rw-r--r-- | telebot/telebot.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/telebot/telebot.go b/telebot/telebot.go index d452519..5cf2045 100644 --- a/telebot/telebot.go +++ b/telebot/telebot.go @@ -69,12 +69,13 @@ func GetProxiedClient() (*http.Client, error) { func getTGBot() *tgbotapi.BotAPI { token := os.Getenv(telegramBotTokenEnvVar) - client, err := GetProxiedClient() - if err != nil { - log.Fatal().Err(err) - } + // client, err := GetProxiedClient() + // if err != nil { + // log.Fatal().Err(err) + // } - bot, err := tgbotapi.NewBotAPIWithClient(token[1:len(token)-1], client) + // bot, err := tgbotapi.NewBotAPIWithClient(token[1:len(token)-1], client) + bot, err := tgbotapi.NewBotAPI(token[1 : len(token)-1]) if err != nil { log.Fatal().Err(err) } @@ -84,6 +85,7 @@ func getTGBot() *tgbotapi.BotAPI { func sendMessage(bot *tgbotapi.BotAPI, msgText string, channelID int64) error { msg := tgbotapi.NewMessage(channelID, msgText) + fmt.Println("XXXXXXXXXXXXXXXXXX", msg) _, err := bot.Send(msg) return err |