User Resource¶
Note
The following classes come from the scurrypy.resources.user module.
User
dataclass
¶
Bases: BaseResource
A Discord user.
id: int
instance-attribute
¶
ID of the user.
context: Any
instance-attribute
¶
Associated user data.
fetch
async
¶
Fetch this user by ID.
Note
Fetch includes both /users/@me AND /users/{user.id}!
Returns:
-
UserModel–the User object
fetch_guilds
async
¶
Fetch this user's guilds.
Important
Requires the OAuth2 guilds scope!
Parameters:
-
**kwargs(Unpack[FetchUserGuildsParams], default:{}) –user guilds fetch params
Note
If no kwargs are provided, default to 200 guilds limit.
Returns:
-
list[GuildModel]–each guild's data
fetch_guild_member
async
¶
Fetch this user's guild member data.
Important
Requires the OAuth2 guilds.members.read scope!
Parameters:
-
guild_id(int) –ID of guild to fetch data from
Returns:
-
GuildMemberModel–member data from guild
FetchUserGuildsParams
¶
Bases: TypedDict
before: int
instance-attribute
¶
Get guilds before this guild ID.
after: int
instance-attribute
¶
Get guilds after this guild ID.
limit: int
instance-attribute
¶
Max number of guilds to return. Range 1 - 200. Default 200.
with_counts: bool
instance-attribute
¶
Include approximate member and presence count.