HelpProvider

interface HelpProvider

Interface representing the main functionality required for extensions that replace the bundled HelpExtension.

This is a fairly rigid interface to try to ensure that users are given a consistent user experience. If this is too restrictive, please open an issue on GitHub and chat to us!

Note: There are expected behaviours from functions that implement this interface. Please read the doc comments before writing your own implementation.

Inheritors

Functions

Link copied to clipboard
open suspend fun formatCommandHelp(context: ChatCommandContext<*>, command: ChatCommand<out Arguments>, longDescription: Boolean = false): Triple<String, String, String>

Given a command object and command context, return a triple representing the formatted command name and signature, formatted command description and formatted argument list.

abstract suspend fun formatCommandHelp(prefix: String, event: MessageCreateEvent, command: ChatCommand<out Arguments>, longDescription: Boolean = false): Triple<String, String, String>

Given a command object and command prefix string, return a triple representing the formatted command name and signature, formatted command description and formatted argument list.

Link copied to clipboard
abstract suspend fun gatherCommands(event: MessageCreateEvent): List<ChatCommand<out Arguments>>

Gather all available commands (with passing checks) from the bot, and return them.

Link copied to clipboard
abstract suspend fun getCommand(event: MessageCreateEvent, args: List<String>): ChatCommand<out Arguments>?

Return the MessageCommand specified in the arguments, or null if it can't be found (or the checks fail).

Link copied to clipboard
open suspend fun getCommandHelpPaginator(context: ChatCommandContext<*>, command: ChatCommand<out Arguments>?): BasePaginator
open suspend fun getCommandHelpPaginator(context: ChatCommandContext<*>, args: List<String>): BasePaginator

Given a command context and argument list, attempt to find the command represented by the arguments and return a BasePaginator, ready to be sent.

abstract suspend fun getCommandHelpPaginator(event: MessageCreateEvent, prefix: String, command: ChatCommand<out Arguments>?): BasePaginator
abstract suspend fun getCommandHelpPaginator(event: MessageCreateEvent, prefix: String, args: List<String>): BasePaginator

Given an event, prefix and argument list, attempt to find the command represented by the arguments and return a BasePaginator, ready to be sent.

Link copied to clipboard

Given a command context, return a BasePaginator containing help information for all loaded commands with passing checks.

abstract suspend fun getMainHelpPaginator(event: MessageCreateEvent, prefix: String): BasePaginator

Given an event and prefix, return a BasePaginator containing help information for all loaded commands with passing checks.