Guild Parser Implementation¶
Parser implementations for disnake.Guild type.
Classes¶
- class disnake_compass.impl.parser.guild.GuildParser(int_parser=NOTHING, *, allow_api_requests=True)[source]¶
-
Parser type with support for guilds.
Warning
This parser can make API requests.
- Parameters:
Attributes¶
Methods¶
- await dumps(argument)[source]¶
Dump a guild into a string.
This uses the underlying
int_parser.- Parameters:
argument (
Guild) – The value that is to be dumped.
- await loads(argument, /)[source]¶
Load a guild from a string.
This uses the underlying
int_parser.- Parameters:
argument (
str) – The value that is to be loaded into a guild.- Raises:
LookupError – A guild with the id stored in the
argumentcould not be found.
- class disnake_compass.impl.parser.guild.InviteParser(*, with_counts=True, with_expiration=True, guild_scheduled_event_id=None)[source]¶
-
Parser type with support for guilds.
Warning
This parser can make API requests.
- Parameters:
with_counts (
bool) – Whether to include count information in the invite.with_expiration (
bool) – Whether to include the expiration date of the invite.guild_scheduled_event_id (
int) –The ID of the scheduled event to include in the invite.
If not provided, defaults to the
eventparameter in the URL if it exists, or the ID of the scheduled event contained in the provided invite object.
Attributes¶
Methods¶
- await dumps(argument, /)[source]¶
Dump a guild invite into a string.
This uses the underlying
int_parser.- Parameters:
argument (
Invite) – The value that is to be dumped.
- await loads(argument)[source]¶
Load a guild invite from a string.
This uses the underlying
int_parser.This method first tries to get the invite from cache. If this fails, it will try to fetch the invite instead.
Warning
This method can make API requests.
- Parameters:
argument (
str) – The value that is to be loaded into a guild invite.
- class disnake_compass.impl.parser.guild.RoleParser(int_parser=NOTHING, *, allow_api_requests=True)[source]¶
-
Parser type with support for roles.
Warning
This parser can make API requests.
- Parameters:
Attributes¶
Methods¶
- await dumps(argument)[source]¶
Dump a role into a string.
This uses the underlying
int_parser.- Parameters:
argument (
Role) – The value that is to be dumped.
- await loads(argument)[source]¶
Load a role from a string.
This uses the underlying
int_parser.- Parameters:
argument (
str) – The value that is to be loaded into a role.- Raises:
LookupError – A role with the id stored in the
argumentcould not be found.