mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
Shamrock
: fix #110
This commit is contained in:
parent
5c10a5a04e
commit
7b07698f7b
@ -13,7 +13,7 @@ import moe.fuqiuluo.shamrock.tools.EmptyJsonString
|
|||||||
internal object SendGroupNotice: IActionHandler() {
|
internal object SendGroupNotice: IActionHandler() {
|
||||||
override suspend fun internalHandle(session: ActionSession): String {
|
override suspend fun internalHandle(session: ActionSession): String {
|
||||||
val groupId = session.getLong("group_id")
|
val groupId = session.getLong("group_id")
|
||||||
val text = session.getString("text")
|
val text = session.getString("content")
|
||||||
val image = session.getStringOrNull("image")
|
val image = session.getStringOrNull("image")
|
||||||
return invoke(groupId, text, image, session.echo)
|
return invoke(groupId, text, image, session.echo)
|
||||||
}
|
}
|
||||||
@ -32,6 +32,8 @@ internal object SendGroupNotice: IActionHandler() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override val requiredParams: Array<String> = arrayOf("group_id", "content")
|
||||||
|
|
||||||
override val alias: Array<String> = arrayOf("send_group_notice")
|
override val alias: Array<String> = arrayOf("send_group_notice")
|
||||||
override fun path(): String = "_send_group_notice"
|
override fun path(): String = "_send_group_notice"
|
||||||
}
|
}
|
@ -135,7 +135,7 @@ fun Routing.troopAction() {
|
|||||||
|
|
||||||
getOrPost("/_send_group_notice") {
|
getOrPost("/_send_group_notice") {
|
||||||
val groupId = fetchOrThrow("group_id").toLong()
|
val groupId = fetchOrThrow("group_id").toLong()
|
||||||
val text = fetchOrThrow("text")
|
val text = fetchOrThrow("content")
|
||||||
val image = fetchOrNull("image")
|
val image = fetchOrNull("image")
|
||||||
call.respondText(SendGroupNotice(groupId, text, image), ContentType.Application.Json)
|
call.respondText(SendGroupNotice(groupId, text, image), ContentType.Application.Json)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user