pylav.extension.red.ui.sources package#

Submodules#

pylav.extension.red.ui.sources.equalizer module#

class pylav.extension.red.ui.sources.equalizer.EQPresetsSource(cog, pages, per_page=10)[source]#

Bases: ListPageSource

async format_page(menu, page)[source]#

An abstract method to format the page.

This method must return one of the following types.

If this method returns a str then it is interpreted as returning the content keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a discord.Embed then it is interpreted as returning the embed keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a dict then it is interpreted as the keyword-arguments that are used in both discord.Message.edit() and discord.abc.Messageable.send(). The two of interest are embed and content.

Parameters:
  • menu (Menu) – The menu that wants to format this page.

  • page (Any) – The page returned by PageSource.get_page().

Returns:

See above.

Return type:

Union[:class:`str`, discord.Embed, dict]

get_max_pages()[source]#

int: The maximum number of pages required to paginate this sequence

get_starting_index_and_page_number(menu)[source]#

pylav.extension.red.ui.sources.generic module#

class pylav.extension.red.ui.sources.generic.EntryPickerSource(guild_id, cog, pages, message_str, per_page=25)[source]#

Bases: ListPageSource

async format_page(menu, entry)[source]#

An abstract method to format the page.

This method must return one of the following types.

If this method returns a str then it is interpreted as returning the content keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a discord.Embed then it is interpreted as returning the embed keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a dict then it is interpreted as the keyword-arguments that are used in both discord.Message.edit() and discord.abc.Messageable.send(). The two of interest are embed and content.

Parameters:
  • menu (Menu) – The menu that wants to format this page.

  • page (Any) – The page returned by PageSource.get_page().

Returns:

See above.

Return type:

Union[:class:`str`, discord.Embed, dict]

get_max_pages()[source]#

int: The maximum number of pages required to paginate this sequence

async get_page(page_number)[source]#

Returns either a single element of the sequence or a slice of the sequence.

If per_page is set to 1 then this returns a single element. Otherwise it returns at most per_page elements.

Returns:

The data returned.

Return type:

Union[Any, List[Any]]

get_starting_index_and_page_number(menu)[source]#
class pylav.extension.red.ui.sources.generic.ListSource(cog, title, pages, per_page=10)[source]#

Bases: ListPageSource

async format_page(menu, page)[source]#

An abstract method to format the page.

This method must return one of the following types.

If this method returns a str then it is interpreted as returning the content keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a discord.Embed then it is interpreted as returning the embed keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a dict then it is interpreted as the keyword-arguments that are used in both discord.Message.edit() and discord.abc.Messageable.send(). The two of interest are embed and content.

Parameters:
  • menu (Menu) – The menu that wants to format this page.

  • page (Any) – The page returned by PageSource.get_page().

Returns:

See above.

Return type:

Union[:class:`str`, discord.Embed, dict]

get_max_pages()[source]#

int: The maximum number of pages required to paginate this sequence

get_starting_index_and_page_number(menu)[source]#
class pylav.extension.red.ui.sources.generic.PreformattedSource(pages)[source]#

Bases: ListPageSource

async format_page(menu, page)[source]#

An abstract method to format the page.

This method must return one of the following types.

If this method returns a str then it is interpreted as returning the content keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a discord.Embed then it is interpreted as returning the embed keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a dict then it is interpreted as the keyword-arguments that are used in both discord.Message.edit() and discord.abc.Messageable.send(). The two of interest are embed and content.

Parameters:
  • menu (Menu) – The menu that wants to format this page.

  • page (Any) – The page returned by PageSource.get_page().

Returns:

See above.

Return type:

Union[:class:`str`, discord.Embed, dict]

get_max_pages()[source]#

int: The maximum number of pages required to paginate this sequence

pylav.extension.red.ui.sources.nodes module#

class pylav.extension.red.ui.sources.nodes.NodeListSource(cog, pages)[source]#

Bases: ListPageSource

async format_page(menu, node)[source]#

An abstract method to format the page.

This method must return one of the following types.

If this method returns a str then it is interpreted as returning the content keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a discord.Embed then it is interpreted as returning the embed keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a dict then it is interpreted as the keyword-arguments that are used in both discord.Message.edit() and discord.abc.Messageable.send(). The two of interest are embed and content.

Parameters:
  • menu (Menu) – The menu that wants to format this page.

  • page (Any) – The page returned by PageSource.get_page().

Returns:

See above.

Return type:

Union[:class:`str`, discord.Embed, dict]

get_starting_index_and_page_number(menu)[source]#
class pylav.extension.red.ui.sources.nodes.NodeManageSource(cog)[source]#

Bases: ListPageSource

property entries#
async format_page(menu, node)[source]#

An abstract method to format the page.

This method must return one of the following types.

If this method returns a str then it is interpreted as returning the content keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a discord.Embed then it is interpreted as returning the embed keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a dict then it is interpreted as the keyword-arguments that are used in both discord.Message.edit() and discord.abc.Messageable.send(). The two of interest are embed and content.

Parameters:
  • menu (Menu) – The menu that wants to format this page.

  • page (Any) – The page returned by PageSource.get_page().

Returns:

See above.

Return type:

Union[:class:`str`, discord.Embed, dict]

async get_page(page_number)[source]#

Returns either a single element of the sequence or a slice of the sequence.

If per_page is set to 1 then this returns a single element. Otherwise it returns at most per_page elements.

Returns:

The data returned.

Return type:

Node

get_starting_index_and_page_number(menu)[source]#
target#
class pylav.extension.red.ui.sources.nodes.NodePickerSource(guild_id, cog, pages, message_str)[source]#

Bases: ListPageSource

async format_page(menu, nodes)[source]#

An abstract method to format the page.

This method must return one of the following types.

If this method returns a str then it is interpreted as returning the content keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a discord.Embed then it is interpreted as returning the embed keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a dict then it is interpreted as the keyword-arguments that are used in both discord.Message.edit() and discord.abc.Messageable.send(). The two of interest are embed and content.

Parameters:
  • menu (Menu) – The menu that wants to format this page.

  • page (Any) – The page returned by PageSource.get_page().

Returns:

See above.

Return type:

Union[:class:`str`, discord.Embed, dict]

get_max_pages()[source]#

int: The maximum number of pages required to paginate this sequence

async get_page(page_number)[source]#

Returns either a single element of the sequence or a slice of the sequence.

If per_page is set to 1 then this returns a single element. Otherwise it returns at most per_page elements.

Returns:

The data returned.

Return type:

Union[Any, List[Any]]

get_starting_index_and_page_number(menu)[source]#

pylav.extension.red.ui.sources.player module#

class pylav.extension.red.ui.sources.player.PlayersSource(cog, specified_guild=None)[source]#

Bases: ListPageSource

property entries#
async format_page(menu, player)[source]#

An abstract method to format the page.

This method must return one of the following types.

If this method returns a str then it is interpreted as returning the content keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a discord.Embed then it is interpreted as returning the embed keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a dict then it is interpreted as the keyword-arguments that are used in both discord.Message.edit() and discord.abc.Messageable.send(). The two of interest are embed and content.

Parameters:
  • menu (Menu) – The menu that wants to format this page.

  • page (Any) – The page returned by PageSource.get_page().

Returns:

See above.

Return type:

Union[:class:`str`, discord.Embed, dict]

get_max_pages()[source]#

int: The maximum number of pages required to paginate this sequence.

get_starting_index_and_page_number(menu)[source]#

pylav.extension.red.ui.sources.playlist module#

class pylav.extension.red.ui.sources.playlist.PlaylistListSource(cog, pages)[source]#

Bases: ListPageSource

async format_page(menu, playlists)[source]#

An abstract method to format the page.

This method must return one of the following types.

If this method returns a str then it is interpreted as returning the content keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a discord.Embed then it is interpreted as returning the embed keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a dict then it is interpreted as the keyword-arguments that are used in both discord.Message.edit() and discord.abc.Messageable.send(). The two of interest are embed and content.

Parameters:
  • menu (Menu) – The menu that wants to format this page.

  • page (Any) – The page returned by PageSource.get_page().

Returns:

See above.

Return type:

Union[:class:`str`, discord.Embed, dict]

get_max_pages()[source]#

int: The maximum number of pages required to paginate this sequence

get_starting_index_and_page_number(menu)[source]#
class pylav.extension.red.ui.sources.playlist.PlaylistPickerSource(guild_id, cog, pages, message_str)[source]#

Bases: ListPageSource

async format_page(menu, playlists)[source]#

An abstract method to format the page.

This method must return one of the following types.

If this method returns a str then it is interpreted as returning the content keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a discord.Embed then it is interpreted as returning the embed keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a dict then it is interpreted as the keyword-arguments that are used in both discord.Message.edit() and discord.abc.Messageable.send(). The two of interest are embed and content.

Parameters:
  • menu (Menu) – The menu that wants to format this page.

  • page (Any) – The page returned by PageSource.get_page().

Returns:

See above.

Return type:

Union[:class:`str`, discord.Embed, dict]

get_max_pages()[source]#

int: The maximum number of pages required to paginate this sequence

async get_page(page_number)[source]#

Returns either a single element of the sequence or a slice of the sequence.

If per_page is set to 1 then this returns a single element. Otherwise it returns at most per_page elements.

Returns:

The data returned.

Return type:

Union[Any, List[Any]]

get_starting_index_and_page_number(menu)[source]#
class pylav.extension.red.ui.sources.playlist.TrackMappingSource(guild_id, cog, playlist, author, entries, per_page=10)[source]#

Bases: ListPageSource

async format_page(menu, tracks)[source]#

An abstract method to format the page.

This method must return one of the following types.

If this method returns a str then it is interpreted as returning the content keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a discord.Embed then it is interpreted as returning the embed keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a dict then it is interpreted as the keyword-arguments that are used in both discord.Message.edit() and discord.abc.Messageable.send(). The two of interest are embed and content.

Parameters:
  • menu (Menu) – The menu that wants to format this page.

  • page (Any) – The page returned by PageSource.get_page().

Returns:

See above.

Return type:

Union[:class:`str`, discord.Embed, dict]

get_max_pages()[source]#

int: The maximum number of pages required to paginate this sequence

get_starting_index_and_page_number(menu)[source]#
is_paginating()[source]#

bool: Whether pagination is required.

pylav.extension.red.ui.sources.queue module#

class pylav.extension.red.ui.sources.queue.QueuePickerSource(guild_id, cog)[source]#

Bases: QueueSource

async format_page(menu, tracks)[source]#

An abstract method to format the page.

This method must return one of the following types.

If this method returns a str then it is interpreted as returning the content keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a discord.Embed then it is interpreted as returning the embed keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a dict then it is interpreted as the keyword-arguments that are used in both discord.Message.edit() and discord.abc.Messageable.send(). The two of interest are embed and content.

Parameters:
  • menu (Menu) – The menu that wants to format this page.

  • page (Any) – The page returned by PageSource.get_page().

Returns:

See above.

Return type:

Union[:class:`str`, discord.Embed, dict]

async get_page(page_number)[source]#

Returns either a single element of the sequence or a slice of the sequence.

If per_page is set to 1 then this returns a single element. Otherwise it returns at most per_page elements.

Returns:

The data returned.

Return type:

Union[Any, List[Any]]

class pylav.extension.red.ui.sources.queue.QueueSource(guild_id, cog, history=False)[source]#

Bases: ListPageSource

property entries#
async format_page(menu, tracks)[source]#

An abstract method to format the page.

This method must return one of the following types.

If this method returns a str then it is interpreted as returning the content keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a discord.Embed then it is interpreted as returning the embed keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a dict then it is interpreted as the keyword-arguments that are used in both discord.Message.edit() and discord.abc.Messageable.send(). The two of interest are embed and content.

Parameters:
  • menu (Menu) – The menu that wants to format this page.

  • page (Any) – The page returned by PageSource.get_page().

Returns:

See above.

Return type:

Union[:class:`str`, discord.Embed, dict]

get_max_pages()[source]#

int: The maximum number of pages required to paginate this sequence.

async get_page(page_number)[source]#

Returns either a single element of the sequence or a slice of the sequence.

If per_page is set to 1 then this returns a single element. Otherwise it returns at most per_page elements.

Returns:

The data returned.

Return type:

Union[Any, List[Any]]

get_starting_index_and_page_number(menu)[source]#
is_paginating()[source]#

bool: Whether pagination is required.

class pylav.extension.red.ui.sources.queue.SearchPickerSource(entries, cog, per_page=10)[source]#

Bases: ListPageSource

entries#
async format_page(menu, entries)[source]#

An abstract method to format the page.

This method must return one of the following types.

If this method returns a str then it is interpreted as returning the content keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a discord.Embed then it is interpreted as returning the embed keyword argument in discord.Message.edit() and discord.abc.Messageable.send().

If this method returns a dict then it is interpreted as the keyword-arguments that are used in both discord.Message.edit() and discord.abc.Messageable.send(). The two of interest are embed and content.

Parameters:
  • menu (Menu) – The menu that wants to format this page.

  • page (Any) – The page returned by PageSource.get_page().

Returns:

See above.

Return type:

Union[:class:`str`, discord.Embed, dict]

get_max_pages()[source]#

int: The maximum number of pages required to paginate this sequence

async get_page(page_number)[source]#

Returns either a single element of the sequence or a slice of the sequence.

If per_page is set to 1 then this returns a single element. Otherwise it returns at most per_page elements.

Returns:

The data returned.

Return type:

Union[Any, List[Any]]

Module contents#