Skip to content

Commit

Permalink
fix: 🐛 Fix None default role in user installed apps. (#2650)
Browse files Browse the repository at this point in the history
* 🐛 Fix `None` default role in user installed apps.

* 📝 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>
  • Loading branch information
Paillat-dev and pre-commit-ci[bot] authored Nov 14, 2024
1 parent 63e1ab0 commit e4946ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion discord/member.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e4946ec

Please sign in to comment.