-
-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for groups #25
base: main
Are you sure you want to change the base?
Conversation
react only for mention in group or for all messages directly in private chats
need import strings |
Signed-off-by: Administrator <[email protected]>
You can use the native IsGroup and IsSuperGroup methods. PS: Does this work in groups when the bot's privacy mode is enabled? |
I'm still getting a message "You are not authorized to use this bot." , when using the bot in a group. |
Same here |
Leave TELEGRAM_ID empty |
When receiving a group message, should you delete the prefix before sending it? feed, err := chatGPT.SendMessage(strings.TrimPrefix(updateText,"@" + bot.Username), updateChatID) |
IMO, we should support both isChatBotInGroup := update.Message.Chat.Type == "group" || update.Message.Chat.Type == "supergroup"
isAtChatBot := strings.HasPrefix(update.Message.Text, "@"+bot.Username) || strings.HasSuffix(update.Message.Text, "@"+bot.Username)
isPrivateChat := update.Message.Chat.IsPrivate()
if !update.Message.IsCommand() && (isChatBotInGroup && isAtChatBot || isPrivateChat) {
}
|
react only for mention in group or for all messages directly in private chats