From 407fad6e75a43e9a29f22bc7ee375f211d3d8922 Mon Sep 17 00:00:00 2001 From: "zhiqiang.wang" Date: Mon, 1 Jul 2024 11:28:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DBot=E6=BD=9C=E5=9C=A8?= =?UTF-8?q?=E5=8E=86=E5=8F=B2webHook=20=E9=94=99=E8=AF=AF=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/monitor/telegram.go | 12 +++++++++--- main/main.go | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/monitor/telegram.go b/app/monitor/telegram.go index 658c4e5..1922c03 100644 --- a/app/monitor/telegram.go +++ b/app/monitor/telegram.go @@ -9,15 +9,21 @@ import ( var err error func BotStart(version string) { - var BotApi = telegram.GetBotApi() - if BotApi == nil { + var botApi = telegram.GetBotApi() + if botApi == nil { return } + _, err = botApi.MakeRequest("deleteWebhook", tgbotapi.Params{}) + if err != nil { + + log.Error("TG Bot deleteWebhook Error:", err) + } + u := tgbotapi.NewUpdate(0) u.Timeout = 60 - updates := BotApi.GetUpdatesChan(u) + updates := botApi.GetUpdatesChan(u) if err != nil { log.Error("TG Bot GetUpdatesChan Error:", err) diff --git a/main/main.go b/main/main.go index da1f5ee..126632c 100644 --- a/main/main.go +++ b/main/main.go @@ -12,7 +12,7 @@ import ( ) // Version 版本号说明 1.0.0 代表主版本号.功能版本号.修订号 -const Version = "1.9.22" +const Version = "1.9.23" func main() { if err := model.Init(); err != nil {