diff --git a/main.go b/main.go index 44fb026..f18b8bc 100644 --- a/main.go +++ b/main.go @@ -5,6 +5,7 @@ import ( "log" "os" "os/signal" + "strings" "strconv" "syscall" "time" @@ -87,7 +88,7 @@ func main() { } bot.Request(tgbotapi.NewChatAction(update.Message.Chat.ID, "typing")) - if !update.Message.IsCommand() && (update.Message.Chat.IsPrivate() || (update.Message.Chat.Type == "group" || update.Message.Chat.Type == "supergroup") && strings.HasPrefix(update.Message.Text, "@" + bot.Self.UserName)) { + if !update.Message.IsCommand() && (update.Message.Chat.IsPrivate() || ((update.Message.Chat.Type == "group" || update.Message.Chat.Type == "supergroup") && strings.HasPrefix(update.Message.Text, "@" + bot.Self.UserName))) { feed, err := chatGPT.SendMessage(update.Message.Text, userConversations[update.Message.Chat.ID].ConversationID, userConversations[update.Message.Chat.ID].LastMessageID) if err != nil { msg.Text = fmt.Sprintf("Error: %v", err)