Skip to content
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

telegram: super-long text support #425

Merged
merged 4 commits into from
Dec 11, 2024
Merged

telegram: super-long text support #425

merged 4 commits into from
Dec 11, 2024

Conversation

sudoskys
Copy link
Member

@sudoskys sudoskys commented Dec 11, 2024

Summary by CodeRabbit

  • New Features

    • Enhanced message formatting across multiple bots by integrating markdownify for improved text processing.
  • Bug Fixes

    • Refined error handling for voice messages in the Telegram bot.
    • Updated error reporting in the Slack bot's upload method to return exceptions directly.
  • Chores

    • Updated the telegramify-markdown dependency version to >=0.2.0 in the project configuration.

…matting

🔧 chore(dependencies): bump telegramify-markdown version to 0.1.14
…matting

🔧 chore(dependencies): bump telegramify-markdown version to 0.1.14
🔧 refactor: update telegramify-markdown package version to 0.2.0

✨ feat: implement content-type handling in telegram receiver

🔧 refactor: adjust indentation in telegram receiver methods
Copy link
Contributor

coderabbitai bot commented Dec 11, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request introduces significant updates across multiple modules to enhance text formatting and message handling in various bot implementations. The primary change is the replacement of the convert function with markdownify from the telegramify_markdown library, affecting how messages are processed and displayed in Discord, Kook, Slack, and Telegram bots. Additionally, error handling improvements and adjustments to the reply method in the Telegram bot enhance message dispatching control. The dependency on telegramify-markdown is also updated to a newer version.

Changes

File Path Change Summary
app/receiver/telegram/init.py - Replaced convert with markdownify for text processing.
- Enhanced error handling in file_forward for voice messages.
- Restructured reply method to process messages with telegramify_markdown.telegramify, including a delay for message dispatch.
app/sender/discord/init.py - Updated import from convert to markdownify.
- Standardized command responses to use markdownify.
app/sender/kook/init.py - Replaced convert with markdownify in command handlers.
- Consistent text formatting updates across commands.
app/sender/slack/init.py - Updated import from convert to markdownify.
- Changed error handling in upload method to return exceptions directly.
app/sender/telegram/init.py - Replaced convert with markdownify in message handlers.
- Updated text parameter in bot.reply_to to utilize markdownify.
app/sender/util_func.py - Updated usage of convert to markdownify in error handling and login functions.
pyproject.toml - Updated telegramify-markdown dependency version from >=0.1.2 to >=0.2.0.

Possibly related PRs

  • 🛠️ fix: fix telegram sender #416: The changes in app/sender/telegram/__init__.py related to the transcribe function enhance message handling, which is relevant to the modifications made in the main PR that also focuses on improving message processing in the TelegramSender class.

🐰 In the land of code where the rabbits play,
Markdown's the magic that brightens the day!
With markdownify now leading the way,
Our messages dance in a beautiful array.
No more convert, just a hop and a cheer,
Error handling's better, so have no fear!
Let's celebrate changes, oh what a delight,
In the code-bunny burrow, everything feels right! 🎉


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between ccecd13 and 5fa65e6.

⛔ Files ignored due to path filters (1)
  • pdm.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • app/receiver/telegram/__init__.py (5 hunks)
  • app/sender/discord/__init__.py (4 hunks)
  • app/sender/kook/__init__.py (5 hunks)
  • app/sender/slack/__init__.py (4 hunks)
  • app/sender/telegram/__init__.py (6 hunks)
  • app/sender/util_func.py (4 hunks)
  • pyproject.toml (1 hunks)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Experiment)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sudoskys sudoskys merged commit b4b11b3 into main Dec 11, 2024
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