aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Matteo Bertucci <[email protected]>2021-04-24 18:47:13 +0200
committerGravatar Matteo Bertucci <[email protected]>2021-04-24 18:47:13 +0200
commitb8429c75eb4366c98fd66fa68eb5b7f06aa2be61 (patch)
tree7d4b5ccab58718848035df0478a6c89e74a82850
parentNomination: properly handle multi messages nominations (diff)
Nominations: send many archive messages if the nomination is too long
-rw-r--r--bot/exts/recruitment/talentpool/_review.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/bot/exts/recruitment/talentpool/_review.py b/bot/exts/recruitment/talentpool/_review.py
index 4f6945043..81c9516ac 100644
--- a/bot/exts/recruitment/talentpool/_review.py
+++ b/bot/exts/recruitment/talentpool/_review.py
@@ -167,7 +167,7 @@ class Reviewer:
embed_content = (
f"{result} on {timestamp}\n"
f"With {seen} {Emojis.ducky_dave} {upvotes} :+1: {downvotes} :-1:\n\n"
- f"{textwrap.shorten(stripped_content, 2048, replace_whitespace=False)}"
+ f"{stripped_content}"
)
if user := await self.bot.fetch_user(user_id):
@@ -175,11 +175,13 @@ class Reviewer:
else:
embed_title = f"Vote for `{user_id}`"
- await self.bot.get_channel(Channels.nomination_archive).send(embed=Embed(
- title=embed_title,
- description=embed_content,
- colour=colour
- ))
+ channel = self.bot.get_channel(Channels.nomination_archive)
+ for number, part in enumerate(textwrap.wrap(embed_content, width=MAX_MESSAGE_SIZE, replace_whitespace=False)):
+ await channel.send(embed=Embed(
+ title=embed_title if number == 0 else None,
+ description="[...] " + part if number != 0 else part,
+ colour=colour
+ ))
for message_ in messages:
await message_.delete()