-
Notifications
You must be signed in to change notification settings - Fork 12
Implement checks for message length before sending #676
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
I think this is actually the only instance of this being a problem so should be fine for review now @CarrotManMatt |
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.
Pull request overview
This PR implements message length validation before sending Discord messages to prevent errors when message content exceeds Discord's 2000-character limit. The implementation adds chunking logic to split long messages into multiple smaller messages for the list_user_actions and list_all_actions commands in the committee actions tracking cog.
Key changes:
- Added
textwrapimport for text wrapping functionality - Implemented message length checks (>= 2000 characters) with chunking logic for
list_user_actionscommand - Implemented message length checks with two-level chunking strategy for
list_all_actionscommand (split by sections, then wrap if sections are too long)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| await ctx.respond( | ||
| content="Actions list exceeds maximum message length, sending in chunks" | ||
| ) |
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.
Should this be sent to the user? Or just a logged message?
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.
I was debating that, tbh I have half a mind to say it's not needed at all. not too bothered
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.
Yh lets get rid of it
Needs some work still, but should fix the problem for the all-actions message atleast