Snowflake Parser Implementation

Parser implementations for basic disnake snowflake types.

Classes

class disnake_compass.impl.parser.snowflake.SnowflakeParser(int_parser=NOTHING)[source]

Bases: Parser[Snowflake]

Parser implementation for disnake.abc.Snowflakes.

Note

As snowflakes are abstact, loads() returns a disnake.Object instead.

Parameters:

int_parser (IntParser) – The IntParser to use internally for this parser.

Attributes

int_parser: IntParser

The IntParser to use internally for this parser.

Since the default integer parser uses base-36 to “compress” numbers, the default guild parser will also return compressed results.

Methods

await dumps(argument, /)[source]

Dump a snowflake into a string.

This uses the underlying int_parser.

Parameters:

argument (Snowflake) – The value that is to be dumped.

await loads(argument, /)[source]

Load a snowflake from a string.

This uses the underlying int_parser.

Parameters:

argument (str) – The value that is to be loaded into a floating point number.