SimpleCommand
abstract class SimpleCommand(owner: CommandOwner, primaryName: String, secondaryNames: String, description: String, parentPermission: Permission, overrideContext: CommandArgumentContext) : AbstractCommand, Command, CommandArgumentContextAware
Content copied to clipboard
简单的, 支持参数自动解析的指令.
要查看指令解析流程, 参考 CommandManager.executeCommand. 要查看参数解析方式, 参考 CommandValueArgumentParser.
Java 示例查看 JSimpleCommand.
Kotlin 示例:
object MySimpleCommand : SimpleCommand(
MyPlugin, "tell",
description = "Message somebody"
) {
@Handler
suspend fun CommandSender.onCommand(target: User, message: String) {
target.sendMessage(message)
}
}
Content copied to clipboard
See also
Constructors
SimpleCommand
Link copied to clipboard
fun SimpleCommand(owner: CommandOwner, primaryName: String, vararg secondaryNames: String, description: String = "no description available", parentPermission: Permission = owner.parentPermission, overrideContext: CommandArgumentContext = EmptyCommandArgumentContext)
Content copied to clipboard
Properties
context
Link copied to clipboard
指令参数环境. 默认为 CommandArgumentContext.Builtins+
overrideContext
description
Link copied to clipboard
overloads
Link copied to clipboard
owner
Link copied to clipboard
permission
Link copied to clipboard
prefixOptional
Link copied to clipboard
primaryName
Link copied to clipboard
secondaryNames
Link copied to clipboard
Inheritors
HelpCommand
Link copied to clipboard
StopCommand
Link copied to clipboard
LogoutCommand
Link copied to clipboard
LoginCommand
Link copied to clipboard
StatusCommand
Link copied to clipboard
JSimpleCommand
Link copied to clipboard