Use negative chat id to detect group

This commit is contained in:
斟酌 鵬兄 2022-09-25 19:09:03 +08:00
parent 41be1db381
commit 35b303f796

View File

@ -33,7 +33,9 @@ func main() {
mesg, err := mtrbus.Query( "zh-Hant", update.Message.Text ).Message()
if update.Message.Chat.IsGroup() {
isGroup := ( update.Message.Chat.ID < 0 )
if isGroup {
if err == nil {
msg := tgbotapi.NewMessage( update.Message.Chat.ID, mesg )
msg.ParseMode = "MarkdownV2"
@ -63,7 +65,7 @@ func main() {
}
err = err2
if update.Message.Chat.IsGroup() {
if isGroup {
if err == nil {
msg := tgbotapi.NewMessage( update.Message.Chat.ID, mesg )
msg.ParseMode = "MarkdownV2"