mirror of
https://github.com/jie65535/JGrasscutterCommand.git
synced 2025-06-01 17:29:13 +08:00
Rename publicCommand to publicCommands
This commit is contained in:
parent
caaf10b813
commit
962b439d47
@ -130,7 +130,7 @@ object JGrasscutterCommand : KotlinPlugin(
|
|||||||
// 普通用户
|
// 普通用户
|
||||||
user = PluginData.users.find { it.id == sender.id && it.serverId == server.id }
|
user = PluginData.users.find { it.id == sender.id && it.serverId == server.id }
|
||||||
if (user == null || user.token.isEmpty()) {
|
if (user == null || user.token.isEmpty()) {
|
||||||
if (server.consoleToken.isNotEmpty() && PluginConfig.publicCommand.contains(command)) {
|
if (server.consoleToken.isNotEmpty() && PluginConfig.publicCommands.contains(command)) {
|
||||||
logger.info("游客用户 ${sender.nameCardOrNick}(${sender.id}) 执行公开命令:$command")
|
logger.info("游客用户 ${sender.nameCardOrNick}(${sender.id}) 执行公开命令:$command")
|
||||||
server.consoleToken
|
server.consoleToken
|
||||||
} else {
|
} else {
|
||||||
|
@ -329,13 +329,13 @@ object PluginCommands : CompositeCommand(
|
|||||||
@SubCommand
|
@SubCommand
|
||||||
@Description("添加公开命令(游客可执行)(可用别名)")
|
@Description("添加公开命令(游客可执行)(可用别名)")
|
||||||
suspend fun CommandSender.addPublicCommand(command: String) {
|
suspend fun CommandSender.addPublicCommand(command: String) {
|
||||||
PluginConfig.publicCommand.add(command)
|
PluginConfig.publicCommands.add(command)
|
||||||
sendMessage("OK")
|
sendMessage("OK")
|
||||||
}
|
}
|
||||||
@SubCommand
|
@SubCommand
|
||||||
@Description("删除公开命令")
|
@Description("删除公开命令")
|
||||||
suspend fun CommandSender.removePublicCommand(alias: String) {
|
suspend fun CommandSender.removePublicCommand(alias: String) {
|
||||||
PluginConfig.publicCommand.remove(alias)
|
PluginConfig.publicCommands.remove(alias)
|
||||||
sendMessage("OK")
|
sendMessage("OK")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ object PluginConfig : AutoSavePluginConfig("config") {
|
|||||||
))
|
))
|
||||||
|
|
||||||
@ValueDescription("公开命令,无需绑定账号也可以执行(可用别名)(必须绑定了控制台令牌才可使用)")
|
@ValueDescription("公开命令,无需绑定账号也可以执行(可用别名)(必须绑定了控制台令牌才可使用)")
|
||||||
val publicCommand: MutableSet<String> by value(mutableSetOf(
|
val publicCommands: MutableSet<String> by value(mutableSetOf(
|
||||||
"/list", "/list uid"
|
"/list", "/list uid"
|
||||||
))
|
))
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user