members#
Useful helper functions for interactin with discord.Member objects.
- async get_or_fetch_member(guild, member_id)[source]#
Attempt to get a member from cache; on failure fetch from the API.
- Return type
- Returns
The
discord.MemberorNoneto indicate the member could not be found.
- async handle_role_change(member, coro, role)[source]#
Await the given
corowithmemberas the sole argument.Handle errors that we expect to be raised from
discord.Member.add_rolesanddiscord.Member.remove_roles.- Parameters
member (
Member) – The member to pass tocoro.coro (
Callable[...,Coroutine]) – This is intended to bediscord.Member.add_rolesordiscord.Member.remove_roles.
- Return type