Browse Source

[bug] fix login failure when tgbot is not active

Co-Authored-By: Alireza Ahmadi <[email protected]>
MHSanaei 1 year ago
parent
commit
2a182d8b9a
1 changed files with 3 additions and 0 deletions
  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