Skip to content

feat(telegram): Add support for groups #183

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

Merged
merged 1 commit into from
May 26, 2025
Merged

feat(telegram): Add support for groups #183

merged 1 commit into from
May 26, 2025

Conversation

mudler
Copy link
Owner

@mudler mudler commented May 26, 2025

Now the bot can be added to groups - in order for this to work correctly you have to turn off privacy mode in groups from Botfather

@Copilot Copilot AI review requested due to automatic review settings May 26, 2025 07:35
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for Telegram groups, allowing the bot to handle messages from group and supergroup chats when enabled via configuration. Key changes include the introduction of group mode and mention-only options, new logic in the handleGroupMessage function, and updates to configuration fields for group support.

Comments suppressed due to low confidence (1)

services/connectors/telegram.go:89

  • [nitpick] Consider renaming the variable 'message' to 'cleanMessage' to avoid potential confusion with the original message text and improve clarity.
message := strings.ReplaceAll(update.Message.Text, "@"+botInfo.Username, "")

xlog.Error("Error getting file", "error", err)
} else {
// Download the file content
resp, err := http.Get(file.FilePath)
Copy link
Preview

Copilot AI May 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider verifying that the HTTP response status code indicates a successful request before processing the response body, to ensure robust error handling.

Copilot uses AI. Check for mistakes.

Signed-off-by: mudler <mudler@localai.io>
@mudler mudler force-pushed the feat/telegram_groups branch from 6505e63 to 729a09c Compare May 26, 2025 07:36
@mudler mudler merged commit 37aa532 into main May 26, 2025
1 check passed
@mudler mudler deleted the feat/telegram_groups branch May 26, 2025 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant