Add try_user, owner and owners to Client #7

Merged
paris-ci merged 7 commits from try_user into 2.0 2021-09-02 19:24:52 +00:00
paris-ci commented 2021-08-28 18:41:50 +00:00 (Migrated from github.com)

Summary

  • Added Client.owner and Client.owners
  • Added Client.try_user()
## Summary - Added Client.owner and Client.owners - Added Client.try_user()
SylteA (Migrated from github.com) requested changes 2021-08-29 21:47:38 +00:00
SylteA (Migrated from github.com) commented 2021-08-29 21:39:03 +00:00

If following the style of the rest of the repository, we should exclude this else:

If following the style of the rest of the repository, we should exclude this `else:`
@ -355,0 +385,4 @@
await self.populate_owners()
return await self.try_owners()
async def populate_owners(self):
SylteA (Migrated from github.com) commented 2021-08-29 21:44:34 +00:00

If owners have not been loaded this will return None

If owners have not been loaded this will return `None`
SylteA (Migrated from github.com) requested changes 2021-08-29 22:09:10 +00:00
SylteA (Migrated from github.com) left a comment

Other than this and some code styling it looks good
Please space out the code a bit, everything is so cramped

Other than this and some code styling it looks good Please space out the code a bit, everything is so cramped
@ -827,6 +827,38 @@ class Client:
"""
return self._connection.get_user(id)
async def try_user(self, id: int, /) -> Optional[User]:
SylteA (Migrated from github.com) commented 2021-08-29 22:08:23 +00:00

Missing versionadded

Missing versionadded
SylteA (Migrated from github.com) commented 2021-08-29 22:04:05 +00:00

I would maybe return the owners here

I would **maybe** return the owners here
paris-ci (Migrated from github.com) reviewed 2021-08-29 22:36:02 +00:00
paris-ci (Migrated from github.com) commented 2021-08-29 22:36:02 +00:00

Return type wouldn't really be consistent or useful imo.

Return type wouldn't really be consistent or useful imo.
IAmTomahawkx (Migrated from github.com) reviewed 2021-09-02 19:23:28 +00:00
IAmTomahawkx (Migrated from github.com) commented 2021-09-02 19:23:27 +00:00

not returning the owners is fine

not returning the owners is fine
IAmTomahawkx (Migrated from github.com) approved these changes 2021-09-02 19:24:35 +00:00
IAmTomahawkx (Migrated from github.com) left a comment

LGTM

LGTM
Sign in to join this conversation.
No description provided.