Skip to content

Commit

Permalink
Base & Meme: Deal with messages > 2000 characters
Browse files Browse the repository at this point in the history
This directly touches issue #279
  • Loading branch information
sinus-x committed Jun 12, 2021
1 parent 9994129 commit 8ec07b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion cogs/base/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,16 @@ async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent):
if len(message.content) >= 1024:
log_embed.add_field(
name="\u200b",
value=message.content[1024:],
value=message.content[1024:2048],
inline=False,
)
if len(message.content) >= 2048:
log_embed.add_field(
name="\u200b",
value="...",
inline=False,
)

if len(message.attachments):
log_embed.add_field(
name=self.text.get("content"),
Expand Down
2 changes: 1 addition & 1 deletion cogs/meme/meme.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ async def randomcase(self, ctx, *, message: str = None):
text += letter.upper() if random.choice((True, False)) else letter.lower()
else:
text += letter
text = self.sanitise(text[:1900], markdown=True)
text = self.sanitise(text, limit=1960)
await ctx.send(f"**{self.sanitise(ctx.author.display_name)}**\n>>> " + text)
await utils.delete(ctx.message)

Expand Down

0 comments on commit 8ec07b5

Please sign in to comment.