Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Commit

Permalink
fix get_group_files_by_folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Simplxss committed Feb 24, 2024
1 parent 5584a41 commit 68ea62e
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ import moe.fuqiuluo.shamrock.tools.EmptyJsonString
import moe.fuqiuluo.symbols.OneBotHandler

@OneBotHandler("get_group_files_by_folder")
internal object GetGroupSubFiles: IActionHandler() {
internal object GetGroupSubFiles : IActionHandler() {
override suspend fun internalHandle(session: ActionSession): String {
val groupId = session.getLong("group_id")
val folderId = session.getString("folder_id")
return invoke(groupId, folderId, session.echo)
}

suspend operator fun invoke(groupId: Long, folderId: String, echo: JsonElement = EmptyJsonString): String {
FileSvc.getGroupFiles(groupId, folderId).onSuccess {
return ok(it, echo = echo)
}.getOrNull()
return error(why = "获取失败", echo = echo)
return ok(
FileSvc.getGroupFiles(groupId, folderId).getOrElse { return error(why = "获取失败: $it", echo = echo) },
echo = echo
)
}

override val requiredParams: Array<String> = arrayOf("group_id", "folder_id")
Expand Down

0 comments on commit 68ea62e

Please sign in to comment.