aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-04-14 16:32:43 +0300
committerGravatar ks129 <[email protected]>2020-04-14 16:32:43 +0300
commit39bac8873120801eb51a2c1a996d2760d9af64a4 (patch)
tree30b48554cb51d30be5bfa0e67abc0abc8e81a419
parent(Big Brother): Added truncating reason. (diff)
(ModLog): Applied force embed description truncating in `send_log_message` to avoid removing newlines.
-rw-r--r--bot/cogs/moderation/modlog.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bot/cogs/moderation/modlog.py b/bot/cogs/moderation/modlog.py
index e15a80c6d..fcc9d4e0a 100644
--- a/bot/cogs/moderation/modlog.py
+++ b/bot/cogs/moderation/modlog.py
@@ -99,7 +99,10 @@ class ModLog(Cog, name="ModLog"):
footer: t.Optional[str] = None,
) -> Context:
"""Generate log embed and send to logging channel."""
- embed = discord.Embed(description=textwrap.shorten(text, width=2048, placeholder="..."))
+ # Truncate string directly here to avoid removing newlines
+ embed = discord.Embed(
+ description=text[:2046] + "..." if len(text) > 2048 else text
+ )
if title and icon_url:
embed.set_author(name=title, icon_url=icon_url)