aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/fun/uwu.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/exts/fun/uwu.py')
-rw-r--r--bot/exts/fun/uwu.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/bot/exts/fun/uwu.py b/bot/exts/fun/uwu.py
index e70d1c0f..d294dc6a 100644
--- a/bot/exts/fun/uwu.py
+++ b/bot/exts/fun/uwu.py
@@ -118,27 +118,39 @@ 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
raise commands.UserInputError("Your message must have content or you must reply to a message.")
-
+
await clean_content(fix_channel_mentions=True).convert(ctx, text)
-
- if fun_cog := ctx.bot.get_cog("Fun"):
+
+ fun_cog = 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)