aboutsummaryrefslogtreecommitdiffstats
path: root/telebot
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
parentremoved goproxy (diff)
downloadhived-f5d387b1be2ad859023e8c66fc7ce04889e6e69d.tar.gz
hived-f5d387b1be2ad859023e8c66fc7ce04889e6e69d.zip
temp fix for the telebot crash
Diffstat (limited to 'telebot')
-rw-r--r--telebot/go.sum2
-rw-r--r--telebot/telebot.go12
2 files changed, 9 insertions, 5 deletions
diff --git a/telebot/go.sum b/telebot/go.sum
index 7478d0b..15eca2b 100644
--- a/telebot/go.sum
+++ b/telebot/go.sum
@@ -1221,6 +1221,8 @@ github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhO
github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M=
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible h1:2cauKuaELYAEARXRkq2LrJ0yDDv1rW7+wrTEdVL3uaU=
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM=
+github.com/go-telegram/bot v0.8.2 h1:5EeOHM6p4H1X1IyXB0uaqw1tnWqLCW8StJAwqfQh+UU=
+github.com/go-telegram/bot v0.8.2/go.mod h1:i2TRs7fXWIeaceF3z7KzsMt/he0TwkVC680mvdTFYeM=
github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
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