-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/telegram/implementation #637
Conversation
updated requirements.txt
fixed errors on admin display
Reviewer's Guide by SourceryThis pull request implements Telegram integration for the Unitap platform. It adds new functionality for connecting Telegram accounts, handling Telegram bot interactions, and introduces new constraints and models related to Telegram connections. Class diagram for Telegram integrationclassDiagram
class TelegramConnection {
+BigIntegerField user_id
+CharField first_name
+CharField last_name
+CharField username
+is_connected() bool
}
class TelegramMessenger {
+send_message(chat_id, text, reply_markup)
+send_photo(chat_id, photo, caption, parse_mode)
+reply_to(message, text, parse_mode)
+update_query_messages(call, text, markup)
}
class TelegramRateLimiter {
+send_telegram_request(func, *args, **kwargs)
}
class BaseTelegramMessageHandler {
+handler(message)
}
class BaseTelegramCommandHandler {
+handler(message, command, args)
}
class BaseTelegramCallbackHandler {
+handler(callback)
}
class BugReportHandler {
+handler(message)
+ask_for_bug_details(message)
+ask_for_bug_occurence(message, user_bug_details)
+collect_image(message, user_bug_details, bug_occurence_details)
+forward_to_private_channel(message, user_bug_details, bug_occurence_details, image)
}
class ReportBugRewardHandler {
+handler(callback)
}
class TelegramUtil {
+verify_login(telegram_data)
}
TelegramConnection <|-- BaseTelegramMessageHandler
TelegramConnection <|-- BaseTelegramCommandHandler
TelegramConnection <|-- BaseTelegramCallbackHandler
BaseTelegramMessageHandler <|-- BugReportHandler
BaseTelegramCallbackHandler <|-- ReportBugRewardHandler
TelegramMessenger <|-- TelegramRateLimiter
TelegramMessenger <|-- BugReportHandler
TelegramMessenger <|-- ReportBugRewardHandler
TelegramMessenger <|-- BaseTelegramMessageHandler
TelegramMessenger <|-- BaseTelegramCommandHandler
TelegramMessenger <|-- BaseTelegramCallbackHandler
TelegramMessenger <|-- TelegramUtil
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @alimaktabi - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
- Implement access control for the broadcast feature (link)
Overall Comments:
- The implementation looks solid, but unit tests should be added to cover the new Telegram functionality before merging.
- Consider moving hardcoded message texts to a separate file or using Django's translation system for easier maintenance and potential future internationalization.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🔴 Security: 1 blocking issue
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Summary by Sourcery
Implement Telegram bot integration with features for user connection, bug reporting, and admin broadcast messaging. Add a new constraint for verifying Telegram connections and update documentation to guide users on using these new features.
New Features:
Enhancements:
Documentation: