aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/exts/fun/uwu.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/bot/exts/fun/uwu.py b/bot/exts/fun/uwu.py
index 81e81b36..0d75b0e2 100644
--- a/bot/exts/fun/uwu.py
+++ b/bot/exts/fun/uwu.py
@@ -169,7 +169,10 @@ class Uwu(Cog):
# If `text` isn't provided then we try to get message content of a replied message
text = text or getattr(ctx.message.reference, "resolved", None)
if isinstance(text, discord.Message):
+ embeds = text.embeds
text = text.content
+ else:
+ embeds = None
if text is None:
# If we weren't able to get the content of a replied message
@@ -178,19 +181,28 @@ class Uwu(Cog):
await clean_content(fix_channel_mentions=True).convert(ctx, text)
fun_cog: t.Optional[Fun] = ctx.bot.get_cog("Fun")
+
if fun_cog:
text, embed = await fun_cog._get_text_and_embed(ctx, text)
- # Grabs the text from the embed for uwuification.
+ # Grabs the text from the embed for uwuification
if embed is not None:
embed = fun_cog._convert_embed(self._uwuify, embed)
+ else:
+ # Only use the first embed since only a single one can be sent
+ embed = fun_cog._convert_embed(self._uwuify, embeds[0]) if embeds else None
else:
embed = None
+
converted_text = self._uwuify(text)
converted_text = helpers.suppress_links(converted_text)
# Adds the text harvested from an embed to be put into another quote block.
- converted_text = f">>> {converted_text.lstrip('> ')}"
+ if text:
+ converted_text = f">>> {converted_text.lstrip('> ')}"
+ else:
+ converted_text = None
+
await ctx.send(content=converted_text, embed=embed)