aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ToxicKidz <[email protected]>2021-05-05 16:50:59 -0400
committerGravatar ToxicKidz <[email protected]>2021-05-05 16:50:59 -0400
commit544a05b00758583f4594569e032c9e661406a72f (patch)
tree32b02c290c2d6f91bd8a0d69eef5e2307a1e34c5
parentfeat: Add the .mosaic command (diff)
chore: Fetch the member and use Colours.blue in the embed for the .mosaic command
-rw-r--r--bot/exts/evergreen/avatar_modification/avatar_modify.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/bot/exts/evergreen/avatar_modification/avatar_modify.py b/bot/exts/evergreen/avatar_modification/avatar_modify.py
index afff125f..bd151d30 100644
--- a/bot/exts/evergreen/avatar_modification/avatar_modify.py
+++ b/bot/exts/evergreen/avatar_modification/avatar_modify.py
@@ -317,6 +317,11 @@ class AvatarModify(commands.Cog):
async def mosaic_command(self, ctx: commands.Context, squares: int = 16) -> None:
"""Splits your avatar into x squares, randomizes them and stitches them back into a new image!"""
async with ctx.typing():
+ member = await self._fetch_member(ctx.author.id)
+ if not member:
+ await ctx.send(f"{Emojis.cross_mark} Could not get member info.")
+ return
+
if squares < 1:
raise commands.BadArgument("Squares must be a positive number")
@@ -327,7 +332,8 @@ class AvatarModify(commands.Cog):
raise commands.BadArgument(f"Number of squares cannot be higher than {MAX_SQUARES:,}.")
file_name = file_safe_name("mosaic_avatar", ctx.author.display_name)
- img_bytes = await ctx.author.avatar_url.read()
+
+ img_bytes = await member.avatar_url.read()
file = await in_executor(
PfpEffects.mosaic_effect,
@@ -348,7 +354,8 @@ class AvatarModify(commands.Cog):
embed = discord.Embed(
title=title,
- description=description
+ description=description,
+ colour=Colours.blue
)
embed.set_image(url=f'attachment://{file_name}')