yuyo.to_builder#
Utility functions for converting Hikari data modals to builders.
to_button_builder #
to_button_builder(button)
Convert a button component to a builder.
Parameters:
-
button
(ButtonComponent
) –The button component to convert to a builder.
Returns:
-
LinkButtonBuilder | InteractiveButtonBuilder
–The buttion builder.
to_channel_select_menu_builder #
to_channel_select_menu_builder(select_menu)
Convert a channel select menu component to a builder.
Parameters:
-
select_menu
(ChannelSelectMenuComponent
) –The select menu to convert to a builder.
Returns:
-
ChannelSelectMenuBuilder
–The select menu builder.
to_cmd_builder #
to_cmd_builder(cmd)
Convert a partial command to a command builder.
Parameters:
-
cmd
(PartialCommand
) –The command to convert to a builder.
Returns:
-
CommandBuilder
–The command builder.
This will always be a subclass.
Raises:
-
NotImplementedError
–If an unsupported command type is passed.
Currently hikari.SlashCommand and hikari.ContextMenuCommand are supported.
to_context_menu_builder #
to_context_menu_builder(cmd)
Convert a context menu command to a builder.
Parameters:
-
cmd
(ContextMenuCommand
) –The context menu command to convert to a builder.
Returns:
-
ContextMenuCommandBuilder
–The context menu command builder.
to_msg_action_row_builder #
to_msg_action_row_builder(action_row)
Convert a message action row component to a builder.
Parameters:
-
action_row
(MessageActionRowComponent
) –The message action row to convert to a builder.
Returns:
-
MessageActionRowBuilder
–The message action row builder.
Raises:
-
NotImplementedError
–If the action row contains an unsupported component type.
The following are currently supported:
to_select_menu_builder #
to_select_menu_builder(select_menu)
Convert a select menu component to a builder.
Parameters:
-
select_menu
(SelectMenuComponent
) –The select menu to convert to a builder.
Returns:
-
SelectMenuBuilder
–The select menu builder.
to_slash_cmd_builder #
to_slash_cmd_builder(cmd)
Convert a slash command to a builder.
Parameters:
-
cmd
(SlashCommand
) –The command to convert to a builder.
Returns:
-
SlashCommandBuilder
–The slash command builder.
to_text_select_menu_builder #
to_text_select_menu_builder(select_menu)
Convert a text select menu component to a builder.
Parameters:
-
select_menu
(TextSelectMenuComponent
) –The select menu to convert to a builder.
Returns:
-
TextSelectMenuBuilder
–The select menu builder.