Skip to content

Commit

Permalink
fix: 修复Bot潜在历史webHook 错误导致无法使用
Browse files Browse the repository at this point in the history
  • Loading branch information
v03413 committed Jul 1, 2024
1 parent 4fb39a0 commit 407fad6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions app/monitor/telegram.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 407fad6

Please sign in to comment.