common / me.schlaubi.regnumutils.command / CommandClientBuilder

CommandClientBuilder

open class CommandClientBuilder

Constructors

<init>

CommandClientBuilder(jda: JDA!)
CommandClientBuilder(shardManager: ShardManager!)

Creates a CommandClientBuilder

Functions

acceptMentionPrefix

open fun acceptMentionPrefix(acceptMentionPrefix: Boolean): CommandClientBuilder

Sets whether the bot should accept a mention as a command prefix or not.

addBotOwners

open fun addBotOwners(vararg botOwnerIds: Long!): CommandClientBuilder
open fun addBotOwners(botOwnerIds: MutableCollection<Long!>!): CommandClientBuilder

Adds bot owners.

build

open fun build(): CommandClient

Builds the CommandClient.

enableDefaultPrefixOverride

open fun enableDefaultPrefixOverride(alwaysDefaultPrefix: Boolean): CommandClientBuilder

Let the bot always accept the default prefix even if there is a custom one.

enableOwnerPermissions

open fun enableOwnerPermissions(ownerPermission: Boolean): CommandClientBuilder

Sets whether the owner should be allowed to execute all commands or not.

enableTyping

open fun enableTyping(sendTyping: Boolean): CommandClientBuilder

Lets the bot send typing before executing a command.

getCommandListener

open fun getCommandListener(): Class<out CommandListenerBase!>

Returns the Class of the currently set CommandListenerBase.

getCommands

open fun getCommands(): MutableList<Command!>!

Returns all currently registered commands.

getConfiguration

open fun getConfiguration(): CommandClientConfiguration

Returns the currently used CommandClientConfiguration.

getExecutor

open fun getExecutor(): ExecutorService

Returns the executor used to execute Commands.

getInformationProvider

open fun getInformationProvider(): InformationProvider!

Returns the information provider.

getPermissionHandler

open fun getPermissionHandler(): PermissionHandler

Returns the currently set permission handler.

registerCommands

open fun registerCommands(vararg commands: Command!): CommandClientBuilder
open fun registerCommands(commands: MutableCollection<Command!>!): CommandClientBuilder

Registers commands without overwriting already registered command.

sendTyping

open fun sendTyping(sendTyping: Boolean): CommandClientBuilder

Sets whether the bot should send typing before it parses commands or not.

setCommandListener

open fun setCommandListener(commandListener: Class<out CommandListenerBase!>): CommandClientBuilder!

Sets the Class of the currently set CommandListenerBase. Changing this from an MessageReceivedCommandListener to an MessageEditCommandListener will also parse MESSAGE_UPDATE events as commands

setCommands

open fun setCommands(commands: MutableList<Command!>): CommandClientBuilder

Sets all currently registered Commands.

setConfiguration

open fun setConfiguration(configuration: CommandClientConfiguration): CommandClientBuilder

Sets the currently used CommandClientConfiguration.

setExecutor

open fun setExecutor(executor: ExecutorService): CommandClientBuilder

Sets the executor used to execute Commands.

setInformationProvider

open fun setInformationProvider(informationProvider: InformationProvider!): CommandClientBuilder

Sets the information provider.

setOwners

open fun setOwners(owners: MutableList<Long!>!): CommandClientBuilder

Sets the list of bot owners.

setPermissionErrorMessageBuilder

open fun setPermissionErrorMessageBuilder(permissionErrorMessageBuilder: Function<Context, Message>!): CommandClientBuilder

Sets the builder for the permissions message that will get send to a user when Context's send methods fails.

setPermissionHandler

open fun setPermissionHandler(permissionHandler: PermissionHandler): CommandClientBuilder

Sets the permission handler to check if a user is allowed to execute a command.

setPrefix

open fun setPrefix(prefix: String!): CommandClientBuilder

Sets the default prefix.