diff options
| author | 2022-08-08 17:46:12 -0400 | |
|---|---|---|
| committer | 2022-08-08 17:46:12 -0400 | |
| commit | 7a41518c9cce2be0cd3ace05d7d3035e8bcbd8bf (patch) | |
| tree | 7343701154e0317cdecd339d8335d9f400b8e73e /bot | |
| parent | Pulled changes from main and fixed conflicts (diff) | |
Add a check for whether an embed is already available via the embeds list, and to use that
Diffstat (limited to 'bot')
| -rw-r--r-- | bot/exts/fun/uwu.py | 19 | 
1 files changed, 10 insertions, 9 deletions
| diff --git a/bot/exts/fun/uwu.py b/bot/exts/fun/uwu.py index 0d75b0e2..ed8925e5 100644 --- a/bot/exts/fun/uwu.py +++ b/bot/exts/fun/uwu.py @@ -183,22 +183,23 @@ class Uwu(Cog):          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 -            if embed is not None: -                embed = fun_cog._convert_embed(self._uwuify, embed) +            if embeds: +                embed = fun_cog._convert_embed(self._uwuify, embeds[0])              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 +                # Parse potential message links in text +                text, embed = await fun_cog._get_text_and_embed(ctx, text) + +                # If an embed is found, grab and uwuify its text +                if embed: +                    embed = fun_cog._convert_embed(self._uwuify, embed)          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.          if text: +            converted_text = self._uwuify(text) +            converted_text = helpers.suppress_links(converted_text)              converted_text = f">>> {converted_text.lstrip('> ')}"          else:              converted_text = None | 
