Package net.mamoe.mirai.console.command.descriptor

Types

AbstractCommandParameter
Link copied to clipboard
abstract class AbstractCommandParameter<T> : CommandParameter<T>
AbstractCommandSignature
Link copied to clipboard
AbstractCommandValueArgumentParser
Link copied to clipboard
abstract class AbstractCommandValueArgumentParser<T : Any> : CommandValueArgumentParser<T>
ArgumentAcceptance
Link copied to clipboard
sealed class ArgumentAcceptance
BooleanValueArgumentParser
Link copied to clipboard

当字符串内容为(不区分大小写) "true", "yes", "enabled", "on", "1"

ByteValueArgumentParser
Link copied to clipboard
CommandArgumentContext
Link copied to clipboard
interface CommandArgumentContext

指令参数环境, 即 CommandValueArgumentParser 的集合, 用于 CompositeCommandSimpleCommand.

CommandArgumentContextAware
Link copied to clipboard
interface CommandArgumentContextAware
CommandArgumentParserException
Link copied to clipboard
class CommandArgumentParserException @JvmOverloads constructor(message: String, cause: Throwable?) : IllegalCommandArgumentException

在解析参数时遇到的 正常 错误. 如参数不符合规范等.

CommandDeclarationException
Link copied to clipboard
open class CommandDeclarationException : RuntimeException
CommandParameter
Link copied to clipboard
interface CommandParameter<T>

Inherited instances must be CommandValueParameter or CommandReceiverParameter

CommandReceiverParameter
Link copied to clipboard
CommandResolutionException
Link copied to clipboard
open class CommandResolutionException : RuntimeException
CommandSignature
Link copied to clipboard
interface CommandSignature

指令签名. 表示指令定义的需要的参数.

CommandSignatureImpl
Link copied to clipboard
open class CommandSignatureImpl(receiverParameter: CommandReceiverParameter<out CommandSender>?, valueParameters: List<AbstractCommandValueParameter<*>>, onCall: suspend CommandSignatureImpl.(resolvedCommandCall: ResolvedCommandCall) -> Unit) : AbstractCommandSignature, CommandSignature
CommandValueArgumentParser
Link copied to clipboard
interface CommandValueArgumentParser<out T : Any>

指令参数解析器. 用于解析字符串或 SingleMessage 到特定参数类型.

CommandValueParameter
Link copied to clipboard
interface CommandValueParameter<T> : CommandParameter<T>

Inherited instances must be AbstractCommandValueParameter.

ContentStringTypeVariant
Link copied to clipboard
DoubleValueArgumentParser
Link copied to clipboard
EmptyCommandArgumentContext
Link copied to clipboard
object EmptyCommandArgumentContext : CommandArgumentContext
EnumValueArgumentParser
Link copied to clipboard
class EnumValueArgumentParser<T : Enum<T>>(type: Class<T>) : InternalCommandValueArgumentParserExtensions<T>

解析参数为枚举 T

ExistingBotValueArgumentParser
Link copied to clipboard

根据 Bot.id 解析一个登录后的 Bot

ExistingFriendValueArgumentParser
Link copied to clipboard

解析任意一个存在的好友.

ExistingGroupValueArgumentParser
Link copied to clipboard

解析任意一个存在的群.

ExistingMemberValueArgumentParser
Link copied to clipboard

解析任意一个群成员.

FloatValueArgumentParser
Link copied to clipboard
ImageValueArgumentParser
Link copied to clipboard

解析 String 通过 Image.

IntValueArgumentParser
Link copied to clipboard

使用 String.toInt 解析

LongValueArgumentParser
Link copied to clipboard
MessageChainTypeVariant
Link copied to clipboard
RawContentValueArgumentParser
Link copied to clipboard

直接返回原始参数 MessageContent

ShortValueArgumentParser
Link copied to clipboard
StringValueArgumentParser
Link copied to clipboard
TemporalArgumentParser
Link copied to clipboard
class TemporalArgumentParser<T : TemporalAccessor>(type: Class<T>, now: () -> T, parse: (CharSequence) -> T) : InternalCommandValueArgumentParserExtensions<T>

解析参数为时间 T

TypeVariant
Link copied to clipboard
interface TypeVariant<out OutType>

Intrinsic variant of an CommandValueArgument.

Functions

buildCommandArgumentContext
Link copied to clipboard
plus
Link copied to clipboard
operator fun CommandArgumentContext.plus(replacer: List<CommandArgumentContext.ParserPair<*>>): CommandArgumentContext

合并 thisreplacer, replacer 将会替换 this 中重复的 parser.

operator fun CommandArgumentContext.plus(replacer: CommandArgumentContext): CommandArgumentContext

合并两个 buildCommandArgumentContext, replacer 将会替换 this 中重复的 parser.