Add Public Commands

This commit is contained in:
2022-09-12 23:29:34 +08:00
parent 08231d4c27
commit 7e50624261
2 changed files with 18 additions and 0 deletions

View File

@ -326,5 +326,18 @@ object PluginCommands : CompositeCommand(
sendMessage("OK")
}
@SubCommand
@Description("添加公开命令(游客可执行)(可用别名)")
suspend fun CommandSender.addPublicCommand(command: String) {
PluginConfig.publicCommand.add(command)
sendMessage("OK")
}
@SubCommand
@Description("删除公开命令")
suspend fun CommandSender.removePublicCommand(alias: String) {
PluginConfig.publicCommand.remove(alias)
sendMessage("OK")
}
// endregion
}

View File

@ -49,4 +49,9 @@ object PluginConfig : AutoSavePluginConfig("config") {
// TODO ...
))
@ValueDescription("公开命令,无需绑定账号也可以执行(可用别名)(必须绑定了控制台令牌才可使用)")
val publicCommand: MutableSet<String> by value(mutableSetOf(
"/list", "/list uid"
))
}