Fix behavior of is_owner for team applications and put all owner IDs in one attribute (#3793)

* blah

* you idiot

* Me likey Danny's way

* Add a warning when bot has no owner set
This commit is contained in:
jack1142
2020-05-29 00:03:23 +02:00
committed by GitHub
parent a9acb80132
commit 05ec73266c
3 changed files with 30 additions and 22 deletions

View File

@@ -58,10 +58,9 @@ def init_events(bot, cli_flags):
if app_info.team:
if bot._use_team_features:
bot.owner_ids = {m.id for m in app_info.team.members}
else:
if bot.owner_id is None:
bot.owner_id = app_info.owner.id
bot.owner_ids.update(m.id for m in app_info.team.members)
elif bot._owner_id_overwrite is None:
bot.owner_ids.add(app_info.owner.id)
bot._app_owners_fetched = True
try:
@@ -184,6 +183,10 @@ def init_events(bot, cli_flags):
if invite_url:
print("\nInvite URL: {}\n".format(invite_url))
if not bot.owner_ids:
# we could possibly exit here in future
log.warning("Bot doesn't have any owner set!")
bot._color = discord.Colour(await bot._config.color())
bot._red_ready.set()
if outdated_red_message: