Users¶
Manager¶
- class UserManager(client: HTTPClient, cache: CacheStorage)¶
Bases:
BaseManagerManager used to fetch
Userobjects.- async fetch_me() User¶
Fetches the user object of the bot. This should generally not be called as it is accessible on startup via
Bot.user.- Raises:
HTTPException – A HTTP error occured.
- async fetch(user_id: int) User¶
Attempts to fetch a
Userfrom the Discord API.- Parameters:
user_id (
int) – The user_id of the user to fetch.- Returns:
The User object recieved from Discord API.
- Return type:
- Raises:
NotFound – Could not find an user with that ID.
HTTPException – A HTTP error occured.
- async get_or_fetch(user_id: int) User¶
A couroutine function that attempts to fetch a
Userfrom internal cache and if not present, makes an API call to discord.- Parameters:
user_id (
int) – The user_id of the user to fetch.- Returns:
The User object recieved from Discord API or cache.
- Return type:
- Raises:
NotFound – Could not find an user with that ID.
HTTPException – A HTTP error occured.
Users¶
- class User(data: UserPayload)¶
Bases:
PartialUser- name¶
- discriminator¶
- global_name¶
- avatar¶
- bot¶
- system¶
- mfa_enabled¶
- banner¶
- accent_color¶
- locale¶
- verified¶
- email¶
- flags¶
- avatar_decoration¶
- nameplate¶
- primary_guild¶
Returns PremiumType.NONE if the user has no Nitro or you are missing identify.premium scope.
- member¶
- id¶
Presences¶
Primary Guild¶
Decorations¶
Members¶
- class PartialMember(data: PartialMemberPayload, *, guild_id: int, user_id: int)¶
Bases:
object- guild_id¶
- id¶
- nick¶
- asset¶
- banner¶
- roles¶
- joined_at¶
- flags¶
- pending¶
- permissions¶
- communication_disabled_until¶
- avatar_decoration_data¶
- nameplate¶
- class Member(data: MemberPayload, *, guild_id: int, user_id: None = None)¶
- class Member(data: MemberPayload, *, guild_id: int, user_id: int)
Bases:
PartialMember- user¶
- deaf¶
- asset¶
- avatar_decoration_data¶
- banner¶
- communication_disabled_until¶
- flags¶
- guild_id¶
- id¶
- joined_at¶
- nameplate¶
- nick¶
- pending¶
- permissions¶
- roles¶
- mute¶