From 73ed64c52707cdbc22652fc397c800dfbe515b14 Mon Sep 17 00:00:00 2001 From: iDutchy <42503862+iDutchy@users.noreply.github.com> Date: Thu, 1 Oct 2020 01:24:25 +0200 Subject: [PATCH] add Bot.owners --- discord/ext/commands/bot.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index 2d56c3f7..26c4a5eb 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -133,6 +133,18 @@ class BotBase(GroupMixin): raise AttributeError('No owner_id specified or you used owner_ids. If you used owner_ids, please refer to `Bot.owners`') return self.get_user(self.owner_id) + @property + def owners(self): + """List[:class:`discord.User`]: The owners, retrieved from owner_ids. In case of improper caching, this list may not contain all owners.""" + if not self.owner_ids or self.owner_id: + raise TypeError('No owner_ids specified or you used owner_id. If you used owner_id, please refer to `Bot.owner`') + owners = [] + for user in self.owner_ids: + owner = self.get_user(user) + if owner: + owners.append(owner) + return owners + # internal helpers def dispatch(self, event_name, *args, **kwargs):