User Parser Implementation¶
Parser implementations for disnake user types.
Classes¶
- class disnake_compass.impl.parser.user.UserParser(int_parser=NOTHING, *, allow_api_requests=True)[source]¶
-
Parser type with support for users.
Warning
This parser can make API requests.
- Parameters:
Attributes¶
Methods¶
- await dumps(argument, /)[source]¶
Dump a user into a string.
This uses the underlying
int_parser.- Parameters:
argument (
User) – The value that is to be dumped.
- await loads(argument, /)[source]¶
Load a user from a string.
This uses the underlying
int_parser.- Parameters:
argument (
str) – The value that is to be loaded into a user.- Raises:
LookupError – A user with the id stored in the
argumentcould not be found.
- class disnake_compass.impl.parser.user.MemberParser(int_parser=NOTHING, *, allow_api_requests=True)[source]¶
-
Asynchronous parser type with support for members.
Warning
This parser can make API requests.
- Parameters:
Attributes¶
Methods¶
- await dumps(argument, /)[source]¶
Dump a user into a string.
This uses the underlying
int_parser.- Parameters:
argument (
Member) – The value that is to be dumped.
- await loads(argument, /)[source]¶
Load a member from a string.
This uses the underlying
int_parser.- Parameters:
argument (
str) – The value that is to be loaded into a member.- Raises:
LookupError – A member with the id stored in the
argumentcould not be found.