From ffda1f7069065fd4ce2b2fe781fbcb5793406f99 Mon Sep 17 00:00:00 2001 From: Matteo Bertucci Date: Tue, 31 Aug 2021 15:01:10 +0200 Subject: 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. --- bot/exts/evergreen/snakes/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bot/exts/evergreen/snakes/_utils.py') diff --git a/bot/exts/evergreen/snakes/_utils.py b/bot/exts/evergreen/snakes/_utils.py index f996d7f8..55acaf1f 100644 --- a/bot/exts/evergreen/snakes/_utils.py +++ b/bot/exts/evergreen/snakes/_utils.py @@ -461,7 +461,7 @@ class SnakeAndLaddersGame: self.players.append(user) self.player_tiles[user.id] = 1 - avatar_bytes = await user.avatar_url_as(format="jpeg", size=PLAYER_ICON_IMAGE_SIZE).read() + avatar_bytes = await user.display_avatar.read() im = Image.open(io.BytesIO(avatar_bytes)).resize((BOARD_PLAYER_SIZE, BOARD_PLAYER_SIZE)) self.avatar_images[user.id] = im -- cgit v1.2.3 From e004e3a048b80ed94410fc7a2703c8d8735b1a54 Mon Sep 17 00:00:00 2001 From: Matteo Bertucci Date: Tue, 31 Aug 2021 15:37:59 +0200 Subject: Snakes: make use of PLAYER_ICON_IMAGE_SIZE again --- bot/exts/evergreen/snakes/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bot/exts/evergreen/snakes/_utils.py') diff --git a/bot/exts/evergreen/snakes/_utils.py b/bot/exts/evergreen/snakes/_utils.py index 55acaf1f..2c825c7c 100644 --- a/bot/exts/evergreen/snakes/_utils.py +++ b/bot/exts/evergreen/snakes/_utils.py @@ -461,7 +461,7 @@ class SnakeAndLaddersGame: self.players.append(user) self.player_tiles[user.id] = 1 - avatar_bytes = await user.display_avatar.read() + avatar_bytes = await user.display_avatar.replace(size=PLAYER_ICON_IMAGE_SIZE).read() im = Image.open(io.BytesIO(avatar_bytes)).resize((BOARD_PLAYER_SIZE, BOARD_PLAYER_SIZE)) self.avatar_images[user.id] = im -- cgit v1.2.3