Skip to content

Conversation

@MattyTheHacker
Copy link
Member

Needs some work still, but should fix the problem for the all-actions message atleast

@MattyTheHacker MattyTheHacker self-assigned this Nov 22, 2025
@MattyTheHacker MattyTheHacker added the bug Something isn't working label Nov 22, 2025
@MattyTheHacker MattyTheHacker linked an issue Nov 22, 2025 that may be closed by this pull request
@MattyTheHacker MattyTheHacker changed the title Fix message max length error Implement checks for message length before sending Nov 22, 2025
@codecov
Copy link

codecov bot commented Nov 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@MattyTheHacker MattyTheHacker added the sync Request bots to automatically keep this PR up to date with it's base branch label Nov 27, 2025
@MattyTheHacker
Copy link
Member Author

I think this is actually the only instance of this being a problem so should be fine for review now @CarrotManMatt

Copy link
Contributor

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 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 textwrap import for text wrapping functionality
  • Implemented message length checks (>= 2000 characters) with chunking logic for list_user_actions command
  • Implemented message length checks with two-level chunking strategy for list_all_actions command (split by sections, then wrap if sections are too long)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +634 to +636
await ctx.respond(
content="Actions list exceeds maximum message length, sending in chunks"
)
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working sync Request bots to automatically keep this PR up to date with it's base branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

400 Bad Request error when message too long

3 participants