Merge pull request #7 from iDutchy/owner

add Bot.owner
This commit is contained in:
iDutchy 2020-10-01 01:22:12 +02:00 committed by GitHub
commit 7356a641b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -126,6 +126,13 @@ class BotBase(GroupMixin):
else: else:
self.help_command = help_command self.help_command = help_command
@property
def owner(self):
""":class:`discord.User`: The owner, retrieved from owner_id. In case of improper caching, this can return None"""
if not self.owner_id or self.owner_ids:
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)
# internal helpers # internal helpers
def dispatch(self, event_name, *args, **kwargs): def dispatch(self, event_name, *args, **kwargs):