-
Notifications
You must be signed in to change notification settings - Fork 22
Fix: too long body #403
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
Fix: too long body #403
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -108,7 +108,7 @@ async def leaderboard_name_autocomplete( | |||||
|
|
||||||
|
|
||||||
| async def _send_split_log(thread: discord.Thread, partial_message: str, header: str, log: str): | ||||||
| if len(partial_message) + len(log) + len(header) < 1900: | ||||||
| if len(partial_message) + len(log) + len(header) < 1800: | ||||||
| partial_message += f"\n\n## {header}:\n" | ||||||
| partial_message += f"```\n{log}```" | ||||||
| return partial_message | ||||||
|
|
@@ -120,7 +120,7 @@ async def _send_split_log(thread: discord.Thread, partial_message: str, header: | |||||
| chunks = [] | ||||||
| partial_message = "" | ||||||
| for line in lines: | ||||||
| if len(partial_message) + len(line) < 1900: | ||||||
| if len(partial_message) + len(line) < 1800: | ||||||
|
||||||
| if len(partial_message) + len(line) < 1800: | |
| if len(partial_message) + len(line) + 1 < 1800: |
Copilot
AI
Jan 25, 2026
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.
The limit_length call still uses 1900 as the limit, which is inconsistent with the changed limits of 1800 in lines 111 and 123. This inconsistency could lead to messages exceeding the intended length limit. Consider updating this to 1800 to match the other changes, or adjust it to account for the header formatting overhead that's added in line 135.
| partial_message += f"```\n{limit_length(chunk, 1900)}```" | |
| partial_message += f"```\n{limit_length(chunk, 1800)}```" |
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.
The length check on this line doesn't accurately account for the formatting overhead. The actual message will be
partial_message + "\n\n## " + header + ":\n" + "```\n" + log + "```", which adds 14 extra characters (7 from the header formatting and 7 from the code block markers). The condition should belen(partial_message) + len(log) + len(header) + 14 < 1800to accurately prevent messages from exceeding the limit.