Skip to content

Commit

Permalink
fix: this doesn't have to be overridable, since owner_ids can just be…
Browse files Browse the repository at this point in the history
… specified as-is
  • Loading branch information
shiftinv committed Sep 23, 2023
1 parent cd006c1 commit 6841baf
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions disnake/ext/commands/common_bot_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,16 @@ async def _fill_owners(self) -> None:

app: disnake.AppInfo = await self.application_info() # type: ignore
if app.team:
self.owners = owners = set(
filter(self._is_team_member_considered_owner, app.team.members)
)
self.owners = owners = {
member
for member in app.team.members
if member.role in (disnake.TeamMemberRole.admin, disnake.TeamMemberRole.developer)
}
self.owner_ids = {m.id for m in owners}
else:
self.owner = app.owner
self.owner_id = app.owner.id

# someone may want to override this behavior, but we'll leave it undocumented for now.
def _is_team_member_considered_owner(self, member: disnake.TeamMember) -> bool:
# these roles can access the bot token, consider them bot owners
return member.role in (disnake.TeamMemberRole.admin, disnake.TeamMemberRole.developer)

async def close(self) -> None:
self._is_closed = True

Expand Down

0 comments on commit 6841baf

Please sign in to comment.