Browse Source

Make arguments positional only in 2 get methods

- Member.get_role
- Guild.get_member
pull/7480/head
Izhar Ahmad 4 years ago
committed by GitHub
parent
commit
efec816de2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      discord/guild.py
  2. 2
      discord/member.py

2
discord/guild.py

@ -736,7 +736,7 @@ class Guild(Hashable):
"""List[:class:`Member`]: A list of members that belong to this guild.""" """List[:class:`Member`]: A list of members that belong to this guild."""
return list(self._members.values()) return list(self._members.values())
def get_member(self, user_id: int) -> Optional[Member]: def get_member(self, user_id: int, /) -> Optional[Member]:
"""Returns a member with the given ID. """Returns a member with the given ID.
Parameters Parameters

2
discord/member.py

@ -890,7 +890,7 @@ class Member(discord.abc.Messageable, _UserTag):
for role in roles: for role in roles:
await req(guild_id, user_id, role.id, reason=reason) await req(guild_id, user_id, role.id, reason=reason)
def get_role(self, role_id: int) -> Optional[Role]: def get_role(self, role_id: int, /) -> Optional[Role]:
"""Returns a role with the given ID from roles which the member has. """Returns a role with the given ID from roles which the member has.
.. versionadded:: 2.0 .. versionadded:: 2.0

Loading…
Cancel
Save