Skip to content

Conversation

@rakibulhaq
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 3, 2025 07:29
@rakibulhaq rakibulhaq linked an issue Jul 3, 2025 that may be closed by this pull request
Copy link

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 introduces a new Telegram message formatter, integrates it into the Telegram channel, adds corresponding tests, and bumps the project version.

  • Add TelegramMessageFormatter to format and escape message dictionaries for Telegram output.
  • Update Formatter base class return type to Any and switch Telegram channel to use the new formatter.
  • Add unit tests for Telegram formatter and bump version to 0.1.3.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/shondesh/formatters/test_telegram_message_formatter.py Add tests covering TelegramMessageFormatter behavior
shondesh/formatters/telegram_message_formatter.py Implement message escaping, HTML wrapping, and formatting
shondesh/formatters/base_formatter.py Change format return type from str to Any
shondesh/formatters/slack_message_formatter.py Import and extend Formatter for Slack formatter
shondesh/channels/telegram.py Set default formatter to TelegramMessageFormatter
pyproject.toml Bump project version from 0.1.2 to 0.1.3
Comments suppressed due to low confidence (3)

shondesh/formatters/telegram_message_formatter.py:14

  • The docstring lists message as str but it's actually a dict. Update the parameter type and description to reflect that message is a dictionary.
            message (str): The message to format.

shondesh/formatters/telegram_message_formatter.py:36

  • The comment says 'double newlines' but the code uses a single \n. Either update the comment to 'single newline' or change the join to "\n\n" if double spacing was intended.
        # Join the message parts with double newlines for better readability

shondesh/formatters/slack_message_formatter.py:1

  • The SlackMessageFormatter was updated to extend Formatter but lacks unit tests. Add tests to verify its format() behavior.
from shondesh.formatters.base_formatter import Formatter

"""
if not message:
return ""

Copy link

Copilot AI Jul 3, 2025

Choose a reason for hiding this comment

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

[nitpick] Mutating the input message dict in place can cause side-effects. Consider building a new dictionary or list of formatted parts instead of overwriting message.

Suggested change
formatted_message = {}

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Jul 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@rakibulhaq rakibulhaq merged commit 9edfa85 into main Jul 3, 2025
4 checks passed
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.

Add Custom formatter integration support

2 participants