ConsoleCommandSender

控制台指令执行者. 代表由控制台执行指令

控制台拥有一切指令的执行权限.

不建议在 CompositeCommand 中使用 ConsoleCommandSender, 使用 SystemCommandSender 以允许其他插件执行

Functions

Link copied to clipboard
suspend fun CommandSender.add(account: Long, password: String, passwordKind: AutoLoginConfig.Account.PasswordKind = PLAIN)
Link copied to clipboard
Link copied to clipboard
suspend fun CommandSender.cancel(target: PermitteeId, permission: Permission)
fun Permittee.cancel(vararg permissions: Permission, recursive: Boolean)
Link copied to clipboard
suspend fun CommandSender.cancelAll(target: PermitteeId, permission: Permission)
Link copied to clipboard
suspend fun CommandSender.clear()
Link copied to clipboard
inline suspend fun CommandSender.executeCommand(message: String, checkPermission: Boolean = true): CommandExecuteResult

解析并执行一个指令

Link copied to clipboard
inline fun <R> CommandSender.fold(ifIsSystem: SystemCommandSender.() -> R, ifIsUser: UserCommandSender.() -> R, otherwise: CommandSender.() -> R = { error("CommandSender ${this::class.qualifiedName} is not supported") }): R

折叠 CommandSender 的可能性.

Link copied to clipboard

尝试获取 Bot.

Link copied to clipboard
Link copied to clipboard
suspend fun CommandSender.handle()
suspend fun CommandSender.handle(id: Long, password: String? = null, protocol: BotConfiguration.MiraiProtocol? = null)
suspend fun CommandSender.handle(id: Long)
suspend fun CommandSender.handle()
suspend fun CommandSender.handle()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

thisUserCommandSender 时返回 true

Link copied to clipboard
suspend fun CommandSender.list()
Link copied to clipboard
Link copied to clipboard
suspend fun CommandSender.permit(target: PermitteeId, permission: Permission)
fun Permittee.permit(vararg permissions: Permission)
Link copied to clipboard
suspend fun CommandSender.permittedPermissions(target: PermitteeId, all: Boolean = true)
Link copied to clipboard
suspend fun CommandSender.remove(account: Long)
Link copied to clipboard
inline fun <R> CommandSender.scopeWith(action: MessageScope.() -> R): R
inline fun <R> CommandSender?.scopeWith(vararg others: CommandSender?, action: MessageScope.() -> R): R
inline fun <R> CommandSender?.scopeWith(vararg others: MessageScope?, action: MessageScope.() -> R): R
inline fun <R> CommandSender?.scopeWith(vararg others: Contact?, action: MessageScope.() -> R): R
Link copied to clipboard
inline suspend fun CommandSender.sendAnsiMessage(capacity: Int = 16, builder: AnsiMessageBuilder.() -> Unit): MessageReceipt<Contact>?

CommandSender 发送一条带有 ANSI 控制符的信息

Link copied to clipboard
open suspend override fun sendMessage(message: String): Nothing?
open suspend override fun sendMessage(message: Message): Nothing?

立刻发送一条消息.

Link copied to clipboard
Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
open override val bot: Nothing?

与这个 CommandSender 相关的 Bot. 当通过控制台执行时为 null.

Link copied to clipboard
Link copied to clipboard
open override val isAnsiSupported: Boolean

当前 SystemCommandSender 是否支持 Ansi 信息

Link copied to clipboard
const val NAME: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val subject: Nothing?

与这个 CommandSender 相关的 Contact.

Link copied to clipboard
open override val user: Nothing?

指令原始发送.