Explorar el Código

[bug] fix login failure when tgbot is not active

Co-Authored-By: Alireza Ahmadi <[email protected]>
MHSanaei hace 1 año
padre
commit
2a182d8b9a
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  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