Skip to content

Commit e6c1022

Browse files
add support for groups
react only for mention in group or for all messages directly in private chats
1 parent 30cd60d commit e6c1022

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func main() {
8787
}
8888

8989
bot.Request(tgbotapi.NewChatAction(update.Message.Chat.ID, "typing"))
90-
if !update.Message.IsCommand() {
90+
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)) {
9191
feed, err := chatGPT.SendMessage(update.Message.Text, userConversations[update.Message.Chat.ID].ConversationID, userConversations[update.Message.Chat.ID].LastMessageID)
9292
if err != nil {
9393
msg.Text = fmt.Sprintf("Error: %v", err)

0 commit comments

Comments
 (0)