add /export_denicky slash command to export threads from deníčky channel#158
add /export_denicky slash command to export threads from deníčky channel#158benabraham wants to merge 4 commits intojuniorguru:mainfrom
Conversation
📝 WalkthroughWalkthroughAdds a new module 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 🧪 Unit Test Generation v2 is now available!We have significantly improved our unit test generation capabilities. To enable: Add this to your reviews:
finishing_touches:
unit_tests:
enabled: trueTry it out by using the Have feedback? Share your thoughts on our Discord thread! Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- remove unused thread parameter from can_export_thread - fix owner_id edge case by using None instead of 0 - use asdict for ExportedThread.to_dict consistency - add error handling for export failures in bot.py - add async function tests for export_thread and export_thread_messages https://claude.ai/code/session_01CVuMjC1r98SLQech7r19bA
- remove to_dict() methods, use asdict() directly in to_json() - remove format_datetime(), use .isoformat() directly - remove corresponding tests for removed functions https://claude.ai/code/session_01CVuMjC1r98SLQech7r19bA
Summary
Add /export_denicky slash command to export threads from the "deníčky" channel (ID: 1075087192101244928) to JSON format
Export includes all messages chronologically (oldest to newest) with usernames, not just IDs
Permission checks: only bot owner, moderators (manage_messages permission), or the thread author can export
Response is ephemeral (only visible to the user invoking the command)
Implementation
New files
Modified files
JSON output format
{ "id": 123456789, "name": "Thread name", "created_at": "2024-01-15T09:00:00+00:00", "messages": [ { "id": 1, "author_id": 100, "author_name": "Username", "content": "Message text", "created_at": "2024-01-15T10:00:00+00:00" } ] }