Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions monty/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ class CodeBlock:
minimum_lines: int = 4


class TruncateLimit:
embed_limit: int = 1024


# TODO: every colour across the bot should use colours from this palette
# this includes calling disnake.Colour.blurple() and other methods.
# TODO: redesign colour palette
Expand Down
4 changes: 4 additions & 0 deletions monty/exts/info/github_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,10 @@ def format_embed_expanded_issue(
embed.description = self.render_github_markdown(
body, context=RenderContext(user=issue.organisation, repo=issue.repository)
)

if len(embed.description) > constants.TruncateLimit.embed_limit:
embed.description = embed.description[: constants.TruncateLimit.embed_limit] + "..."

if not body or body.isspace():
embed.description = "*No description provided.*"
return embed
Expand Down