From e4946ecf5c52a1c2900beba45281b6d052444383 Mon Sep 17 00:00:00 2001 From: Paillat Date: Thu, 14 Nov 2024 20:22:31 +0100 Subject: [PATCH] fix: :bug: Fix `None` default role in user installed apps. (#2650) * :bug: Fix `None` default role in user installed apps. * :memo: CHANGELOG.md * style(pre-commit): auto fixes from pre-commit.com hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- CHANGELOG.md | 2 ++ discord/member.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc995ffd76..a9547fbafc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2627](https://github.com/Pycord-Development/pycord/issues/2627)) - Fixed `AttributeError` when sending polls with `PartialWebook`. ([#2624](https://github.com/Pycord-Development/pycord/pull/2624)) +- Fixed `AttributeError` when accessing `Member.guild_permissions` for user installed + apps. ([#2650](https://github.com/Pycord-Development/pycord/pull/2650)) ### Changed diff --git a/discord/member.py b/discord/member.py index f1a546c918..0ff90cce04 100644 --- a/discord/member.py +++ b/discord/member.py @@ -566,7 +566,8 @@ def roles(self) -> list[Role]: role = g.get_role(role_id) if role: result.append(role) - result.append(g.default_role) + if g.default_role: + result.append(g.default_role) result.sort() return result