mirror of
https://github.com/jie65535/JGrasscutterCommand.git
synced 2025-06-01 17:29:13 +08:00
Update version to v0.2.1
This commit is contained in:
parent
7e50624261
commit
caaf10b813
@ -7,7 +7,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "top.jie65535.mirai"
|
group = "top.jie65535.mirai"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven("https://maven.aliyun.com/repository/public")
|
maven("https://maven.aliyun.com/repository/public")
|
||||||
|
@ -40,7 +40,7 @@ object JGrasscutterCommand : KotlinPlugin(
|
|||||||
JvmPluginDescription(
|
JvmPluginDescription(
|
||||||
id = "top.jie65535.mirai.grasscutter-command",
|
id = "top.jie65535.mirai.grasscutter-command",
|
||||||
name = "J Grasscutter Command",
|
name = "J Grasscutter Command",
|
||||||
version = "0.2.0",
|
version = "0.2.1",
|
||||||
) {
|
) {
|
||||||
author("jie65535")
|
author("jie65535")
|
||||||
info("""聊天执行GC命令""")
|
info("""聊天执行GC命令""")
|
||||||
@ -130,12 +130,18 @@ 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)) {
|
||||||
|
logger.info("游客用户 ${sender.nameCardOrNick}(${sender.id}) 执行公开命令:$command")
|
||||||
|
server.consoleToken
|
||||||
|
} else {
|
||||||
return@subscribeAlways
|
return@subscribeAlways
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
logger.info("用户 ${sender.nameCardOrNick}(${sender.id}) 执行命令:$command")
|
logger.info("用户 ${sender.nameCardOrNick}(${sender.id}) 执行命令:$command")
|
||||||
// 使用用户缓存令牌
|
// 使用用户缓存令牌
|
||||||
user.token
|
user.token
|
||||||
}
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
// 调用接口执行命令
|
// 调用接口执行命令
|
||||||
val response = OpenCommandApi.runCommand(server.address, token, command)
|
val response = OpenCommandApi.runCommand(server.address, token, command)
|
||||||
|
Loading…
Reference in New Issue
Block a user