aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/avatar_modification
diff options
context:
space:
mode:
authorGravatar Matteo Bertucci <[email protected]>2021-08-31 15:01:10 +0200
committerGravatar Matteo Bertucci <[email protected]>2021-08-31 15:01:10 +0200
commitffda1f7069065fd4ce2b2fe781fbcb5793406f99 (patch)
tree0a68152f289f4fd1a78386a3313d5cbce584bdfe /bot/exts/evergreen/avatar_modification
parentMerge pull request #831 from brad90four/patch-1 (diff)
Migrate to Discord.py 2.0a0
Since the Discord.py repository has been archived, we can switch to the latest commit of 2.0a0, knowing no breaking change will occur (still pinned to the commit just in case). This commit also solves two small problems due to that fix, the avatar interface changing and Embed.name disappearing. Quite a painless migration.
Diffstat (limited to 'bot/exts/evergreen/avatar_modification')
-rw-r--r--bot/exts/evergreen/avatar_modification/avatar_modify.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/bot/exts/evergreen/avatar_modification/avatar_modify.py b/bot/exts/evergreen/avatar_modification/avatar_modify.py
index 7b4ae9c7..fd586613 100644
--- a/bot/exts/evergreen/avatar_modification/avatar_modify.py
+++ b/bot/exts/evergreen/avatar_modification/avatar_modify.py
@@ -100,7 +100,7 @@ class AvatarModify(commands.Cog):
await ctx.send(f"{Emojis.cross_mark} Could not get user info.")
return
- image_bytes = await user.avatar_url_as(size=1024).read()
+ image_bytes = await user.display_avatar.replace(size=1024).read()
file_name = file_safe_name("eightbit_avatar", ctx.author.display_name)
file = await in_executor(
@@ -116,7 +116,7 @@ class AvatarModify(commands.Cog):
)
embed.set_image(url=f"attachment://{file_name}")
- embed.set_footer(text=f"Made by {ctx.author.display_name}.", icon_url=user.avatar_url)
+ embed.set_footer(text=f"Made by {ctx.author.display_name}.", icon_url=user.display_avatar.url)
await ctx.send(embed=embed, file=file)
@@ -137,7 +137,7 @@ class AvatarModify(commands.Cog):
await ctx.send(f"{Emojis.cross_mark} Could not get user info.")
return
- image_bytes = await user.avatar_url_as(size=1024).read()
+ image_bytes = await user.display_avatar.replace(size=1024).read()
filename = file_safe_name("reverse_avatar", ctx.author.display_name)
file = await in_executor(
@@ -153,7 +153,7 @@ class AvatarModify(commands.Cog):
)
embed.set_image(url=f"attachment://{filename}")
- embed.set_footer(text=f"Made by {ctx.author.display_name}.", icon_url=user.avatar_url)
+ embed.set_footer(text=f"Made by {ctx.author.display_name}.", icon_url=user.display_avatar.url)
await ctx.send(embed=embed, file=file)
@@ -193,7 +193,7 @@ class AvatarModify(commands.Cog):
return
ctx.send = send_message # Reassigns ctx.send
- image_bytes = await user.avatar_url_as(size=256).read()
+ image_bytes = await user.display_avatar.replace(size=256).read()
file_name = file_safe_name("easterified_avatar", ctx.author.display_name)
file = await in_executor(
@@ -205,11 +205,11 @@ class AvatarModify(commands.Cog):
)
embed = discord.Embed(
- name="Your Lovely Easterified Avatar!",
+ title="Your Lovely Easterified Avatar!",
description="Here is your lovely avatar, all bright and colourful\nwith Easter pastel colours. Enjoy :D"
)
embed.set_image(url=f"attachment://{file_name}")
- embed.set_footer(text=f"Made by {ctx.author.display_name}.", icon_url=user.avatar_url)
+ embed.set_footer(text=f"Made by {ctx.author.display_name}.", icon_url=user.display_avatar.url)
await ctx.send(file=file, embed=embed)
@@ -235,7 +235,7 @@ class AvatarModify(commands.Cog):
)
embed = discord.Embed(
- name="Your Lovely Pride Avatar!",
+ title="Your Lovely Pride Avatar!",
description=f"Here is your lovely avatar, surrounded by\n a beautiful {option} flag. Enjoy :D"
)
embed.set_image(url=f"attachment://{file_name}")
@@ -268,7 +268,7 @@ class AvatarModify(commands.Cog):
if not user:
await ctx.send(f"{Emojis.cross_mark} Could not get user info.")
return
- image_bytes = await user.avatar_url_as(size=1024).read()
+ image_bytes = await user.display_avatar.replace(size=1024).read()
await self.send_pride_image(ctx, image_bytes, pixels, flag, option)
@prideavatar.command()
@@ -296,7 +296,7 @@ class AvatarModify(commands.Cog):
return
async with ctx.typing():
- image_bytes = await user.avatar_url_as(size=1024).read()
+ image_bytes = await user.display_avatar.replace(size=1024).read()
file_name = file_safe_name("spooky_avatar", ctx.author.display_name)
@@ -312,7 +312,7 @@ class AvatarModify(commands.Cog):
colour=Colours.soft_red
)
embed.set_image(url=f"attachment://{file_name}")
- embed.set_footer(text=f"Made by {ctx.author.display_name}.", icon_url=ctx.author.avatar_url)
+ embed.set_footer(text=f"Made by {ctx.author.display_name}.", icon_url=ctx.author.display_avatar.url)
await ctx.send(file=file, embed=embed)
@@ -335,7 +335,7 @@ class AvatarModify(commands.Cog):
file_name = file_safe_name("mosaic_avatar", ctx.author.display_name)
- img_bytes = await user.avatar_url_as(size=1024).read()
+ img_bytes = await user.display_avatar.replace(size=1024).read()
file = await in_executor(
PfpEffects.apply_effect,
@@ -362,7 +362,7 @@ class AvatarModify(commands.Cog):
)
embed.set_image(url=f"attachment://{file_name}")
- embed.set_footer(text=f"Made by {ctx.author.display_name}", icon_url=user.avatar_url)
+ embed.set_footer(text=f"Made by {ctx.author.display_name}", icon_url=user.display_avatar.url)
await ctx.send(file=file, embed=embed)