Converters API Reference#

Base#

class lightbulb.converters.base.BaseConverter(context: context_.base.Context)[source]#

Base converter class.

Parameters:

context (Context) – Context to convert the argument under.

abstract async convert(arg: str) T[source]#

Conversion method for the converter.

Parameters:

arg (str) – Argument to convert.

Returns:

Converted argument.

Return type:

T

context: context_.Context#

Context to convert the argument(s) under.


Special#

class lightbulb.converters.special.BooleanConverter(context: context_.base.Context)[source]#

Implementation of the base converter for converting arguments into a boolean.

async convert(arg: str) bool[source]#

Conversion method for the converter.

Parameters:

arg (str) – Argument to convert.

Returns:

Converted argument.

Return type:

T

lightbulb.converters.special.ColorConverter#

Alias for ColorConverter.

class lightbulb.converters.special.ColourConverter(context: context_.base.Context)[source]#

Implementation of the base converter for converting arguments into a Colour object.

async convert(arg: str) Color[source]#

Conversion method for the converter.

Parameters:

arg (str) – Argument to convert.

Returns:

Converted argument.

Return type:

T

class lightbulb.converters.special.EmojiConverter(context: context_.base.Context)[source]#

Implementation of the base converter for converting arguments into an Emoji object.

async convert(arg: str) Emoji[source]#

Conversion method for the converter.

Parameters:

arg (str) – Argument to convert.

Returns:

Converted argument.

Return type:

T

class lightbulb.converters.special.GuildCategoryConverter(context: context_.base.Context)[source]#

Implementation of the base converter for converting arguments into a GuildCategory object.

async convert(arg: str) GuildCategory[source]#

Conversion method for the converter.

Parameters:

arg (str) – Argument to convert.

Returns:

Converted argument.

Return type:

T

class lightbulb.converters.special.GuildChannelConverter(context: context_.base.Context)[source]#

Implementation of the base converter for converting arguments into a GuildChannel object.

async convert(arg: str) GuildChannel[source]#

Conversion method for the converter.

Parameters:

arg (str) – Argument to convert.

Returns:

Converted argument.

Return type:

T

class lightbulb.converters.special.GuildConverter(context: context_.base.Context)[source]#

Implementation of the base converter for converting arguments into a GuildPreview object.

async convert(arg: str) GuildPreview[source]#

Conversion method for the converter.

Parameters:

arg (str) – Argument to convert.

Returns:

Converted argument.

Return type:

T

class lightbulb.converters.special.GuildVoiceChannelConverter(context: context_.base.Context)[source]#

Implementation of the base converter for converting arguments into a GuildVoiceChannel object.

async convert(arg: str) GuildVoiceChannel[source]#

Conversion method for the converter.

Parameters:

arg (str) – Argument to convert.

Returns:

Converted argument.

Return type:

T

class lightbulb.converters.special.InviteConverter(context: context_.base.Context)[source]#

Implementation of the base converter for converting arguments into an Invite object.

async convert(arg: str) Invite[source]#

Conversion method for the converter.

Parameters:

arg (str) – Argument to convert.

Returns:

Converted argument.

Return type:

T

class lightbulb.converters.special.MemberConverter(context: context_.base.Context)[source]#

Implementation of the base converter for converting arguments into a Member object.

async convert(arg: str) Member[source]#

Conversion method for the converter.

Parameters:

arg (str) – Argument to convert.

Returns:

Converted argument.

Return type:

T

class lightbulb.converters.special.MessageConverter(context: context_.base.Context)[source]#

Implementation of the base converter for converting arguments into a Message object.

async convert(arg: str) Message[source]#

Conversion method for the converter.

Parameters:

arg (str) – Argument to convert.

Returns:

Converted argument.

Return type:

T

class lightbulb.converters.special.RoleConverter(context: context_.base.Context)[source]#

Implementation of the base converter for converting arguments into a Role object.

async convert(arg: str) Role[source]#

Conversion method for the converter.

Parameters:

arg (str) – Argument to convert.

Returns:

Converted argument.

Return type:

T

class lightbulb.converters.special.SnowflakeConverter(context: context_.base.Context)[source]#

Implementation of the base converter for converting arguments into a Snowflake object.

async convert(arg: str) Snowflake[source]#

Conversion method for the converter.

Parameters:

arg (str) – Argument to convert.

Returns:

Converted argument.

Return type:

T

class lightbulb.converters.special.TextableGuildChannelConverter(context: context_.base.Context)[source]#

Implementation of the base converter for converting arguments into a TextableGuildChannel object.

async convert(arg: str) TextableGuildChannel[source]#

Conversion method for the converter.

Parameters:

arg (str) – Argument to convert.

Returns:

Converted argument.

Return type:

T

class lightbulb.converters.special.TimestampConverter(context: context_.base.Context)[source]#

Implementation of the base converter for converting arguments into a datetime object.

async convert(arg: str) datetime[source]#

Conversion method for the converter.

Parameters:

arg (str) – Argument to convert.

Returns:

Converted argument.

Return type:

T

class lightbulb.converters.special.UserConverter(context: context_.base.Context)[source]#

Implementation of the base converter for converting arguments into a User object.

async convert(arg: str) User[source]#

Conversion method for the converter.

Parameters:

arg (str) – Argument to convert.

Returns:

Converted argument.

Return type:

T