瀏覽代碼

[bug] fix login failure when tgbot is not active

Co-Authored-By: Alireza Ahmadi <[email protected]>
MHSanaei 1 年之前
父節點
當前提交
2a182d8b9a
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      web/service/tgbot.go

+ 3 - 0
web/service/tgbot.go

@@ -381,6 +381,9 @@ func (t *Tgbot) SendAnswer(chatId int64, msg string, isAdmin bool) {
 }
 
 func (t *Tgbot) SendMsgToTgbot(tgid int64, msg string, inlineKeyboard ...tgbotapi.InlineKeyboardMarkup) {
+	if !isRunning {
+		return
+	}
 	var allMessages []string
 	limit := 2000
 	// paging message if it is big