aboutsummaryrefslogtreecommitdiffstats
path: root/telebot/telebot.go
diff options
context:
space:
mode:
authorterminaldweller <devi@terminaldweller.com>2023-12-04 22:52:15 +0000
committerterminaldweller <devi@terminaldweller.com>2023-12-04 22:52:15 +0000
commitf5d387b1be2ad859023e8c66fc7ce04889e6e69d (patch)
treef99a0613b7f107d085d0246a8056e79442d3c64f /telebot/telebot.go
parentremoved goproxy (diff)
downloadhived-f5d387b1be2ad859023e8c66fc7ce04889e6e69d.tar.gz
hived-f5d387b1be2ad859023e8c66fc7ce04889e6e69d.zip
temp fix for the telebot crash
Diffstat (limited to '')
-rw-r--r--telebot/telebot.go12
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