Skip to content

Conversation

@S1ro1
Copy link
Member

@S1ro1 S1ro1 commented Jan 25, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 25, 2026 00:48
@S1ro1 S1ro1 merged commit 7e37b09 into main Jan 25, 2026
8 of 9 checks passed
@github-actions
Copy link

Coverage report

This PR does not seem to contain any modification to coverable code.

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 addresses an issue with Discord message length limits by reducing the threshold from 1900 to 1800 characters in message length checks. The changes also include a minor style improvement to add proper spacing around the addition operator.

Changes:

  • Reduced message length threshold from 1900 to 1800 characters in two length checks
  • Fixed spacing around the + operator to follow PEP 8 style guidelines

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

for i, chunk in enumerate(chunks):
partial_message = f"\n\n## {header} ({i+1}/{len(chunks)}):\n"
partial_message = f"\n\n## {header} ({i + 1}/{len(chunks)}):\n"
partial_message += f"```\n{limit_length(chunk, 1900)}```"
Copy link

Copilot AI Jan 25, 2026

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.

Suggested change
partial_message += f"```\n{limit_length(chunk, 1900)}```"
partial_message += f"```\n{limit_length(chunk, 1800)}```"

Copilot uses AI. Check for mistakes.

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:
Copy link

Copilot AI Jan 25, 2026

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 be len(partial_message) + len(log) + len(header) + 14 < 1800 to accurately prevent messages from exceeding the limit.

Suggested change
if len(partial_message) + len(log) + len(header) < 1800:
if len(partial_message) + len(log) + len(header) + 14 < 1800:

Copilot uses AI. Check for mistakes.
partial_message = ""
for line in lines:
if len(partial_message) + len(line) < 1900:
if len(partial_message) + len(line) < 1800:
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The length check doesn't account for the newline character that's added in line 124. The condition should be len(partial_message) + len(line) + 1 < 1800 to accurately represent the actual length after the newline is appended.

Suggested change
if len(partial_message) + len(line) < 1800:
if len(partial_message) + len(line) + 1 < 1800:

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants