Skip to content

Commit 13e888a

Browse files
committed
resolve requests.
1 parent dd09db8 commit 13e888a

2 files changed

Lines changed: 5 additions & 17 deletions

File tree

‎cogs/modmail.py‎

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -406,14 +406,7 @@ async def snippet(self, ctx, *, name: str.lower = None):
406406
else:
407407
snippet_data = self.bot.snippets[snippet_name]
408408
snippet_text = self._get_snippet_text(snippet_data)
409-
has_attachment = self._has_snippet_attachment(snippet_data)
410-
411-
if snippet_text:
412-
description = snippet_text
413-
elif has_attachment:
414-
description = "This is an attachment-only snippet."
415-
else:
416-
description = "(No text content)"
409+
description = snippet_text or "This is an attachment-only snippet."
417410

418411
embed = discord.Embed(
419412
title=f'Snippet - "{snippet_name}":',
@@ -446,10 +439,8 @@ async def snippet(self, ctx, *, name: str.lower = None):
446439

447440
if snippet_text:
448441
display_value = return_or_truncate(snippet_text, 350)
449-
elif has_attachment:
450-
display_value = "This is an attachment-only snippet."
451442
else:
452-
display_value = "(No text)"
443+
display_value = "This is an attachment-only snippet."
453444
if has_attachment:
454445
display_value = "📎 " + display_value
455446

@@ -474,15 +465,12 @@ async def snippet_raw(self, ctx, *, name: str.lower):
474465
else:
475466
snippet_data = self.bot.snippets[snippet_name]
476467
snippet_text = self._get_snippet_text(snippet_data)
477-
has_attachment = self._has_snippet_attachment(snippet_data)
478468

479469
if snippet_text:
480470
val = truncate(escape_code_block(snippet_text), 2048 - 7)
481471
description = f"```\n{val}```"
482-
elif has_attachment:
483-
description = "This is an attachment-only snippet."
484472
else:
485-
description = "(No text content)"
473+
description = "This is an attachment-only snippet."
486474

487475
embed = discord.Embed(
488476
title=f'Raw snippet - "{snippet_name}":',

‎core/thread.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,8 +2124,8 @@ def lottie_to_png(data):
21242124
continue
21252125

21262126
if not embedded_image:
2127-
embed.set_image(url=f"attachment://{a.filename}")
2128-
embed.add_field(name="Image", value=a.filename)
2127+
embed.set_image(url=a.url)
2128+
embed.add_field(name="Image", value=f"[{a.filename}]({a.url})")
21292129
embedded_image = True
21302130
# Only reference images that were successfully converted and will be sent.
21312131
discord_files.append(file)

0 commit comments

Comments
 (0)