aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar AG_1436 <[email protected]>2020-01-07 00:15:22 +0530
committerGravatar GitHub <[email protected]>2020-01-07 00:15:22 +0530
commit67d126ea3c66b1c2df2412e3cd9dd96cfb6beb04 (patch)
tree5d47d0d56e5830070ea206d54a263a387f651b87
parentUse a static discord shield on the readme. (diff)
Add exception where relayed message.content length exceed 2048 characters
-rw-r--r--bot/seasons/evergreen/bookmark.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bot/seasons/evergreen/bookmark.py b/bot/seasons/evergreen/bookmark.py
index 9962186f..5b399739 100644
--- a/bot/seasons/evergreen/bookmark.py
+++ b/bot/seasons/evergreen/bookmark.py
@@ -25,11 +25,14 @@ class Bookmark(commands.Cog):
) -> None:
"""Send the author a link to `target_message` via DMs."""
log.info(f"{ctx.author} bookmarked {target_message.jump_url} with title '{title}'")
+ content = target_message.content
+ if len(content) > 250:
+ content = content[:250]+'......'
embed = discord.Embed(
title=title,
colour=Colours.soft_green,
description=(
- f"{target_message.content}\n\n"
+ f"{content}\n\n"
f"[Visit original message]({target_message.jump_url})"
)
)