From ada91b7f9ce61431e4fa6403a2d11ec84a69532c Mon Sep 17 00:00:00 2001 From: Eritque arcus <1930893235@qq.com> Date: Sun, 24 Oct 2021 11:02:17 +0800 Subject: [PATCH] feat(kotlin): FileMessage (not tested) #90 --- kotlin/shared/src/main/kotlin/PublicShared.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/kotlin/shared/src/main/kotlin/PublicShared.kt b/kotlin/shared/src/main/kotlin/PublicShared.kt index da00337a7..32f88fc5e 100644 --- a/kotlin/shared/src/main/kotlin/PublicShared.kt +++ b/kotlin/shared/src/main/kotlin/PublicShared.kt @@ -503,13 +503,24 @@ object PublicShared { return remoteFileList(path, c) c.withGroup(bot, "找不到对应群组,位置K-remoteFileInfo,gid:${c.id}") { group -> val tmp = group.filesRoot.resolve(path).resolveById(id) ?: let { - logger.error("cannot find the file,位置:K-remoteFileinfo, id:$id") + logger.error("cannot find the file,位置:K-remoteFileinfo, id:$id, path:$path") return "E2" } return fileInfo0(tmp) } } + suspend fun remoteFileInfo(id: String, c: Config.Contact): String = + c.withBot { bot -> + c.withGroup(bot, "找不到对应群组,位置K-remoteFileInfo,gid:${c.id}") { group -> + val tmp = group.filesRoot.resolveById(id) ?: let { + logger.error("cannot find the file,位置:K-remoteFileinfo, id:$id") + return "E1" + } + return fileInfo0(tmp) + } + } + //查询权限 fun kqueryM(c: Config.Contact): String = c.withBot { bot ->