mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
Shamrock
: fix #90
This commit is contained in:
parent
8d8846fafb
commit
8c307c4f6e
@ -193,8 +193,8 @@ internal class ActionSession {
|
|||||||
return params[key].asBoolean
|
return params[key].asBoolean
|
||||||
}
|
}
|
||||||
|
|
||||||
fun <T: Boolean?> getBooleanOrDefault(key: String, default: T? = null): T {
|
fun getBooleanOrDefault(key: String, default: Boolean? = null): Boolean {
|
||||||
return (params[key].asBooleanOrNull as? T) ?: default as T
|
return params[key].asBooleanOrNull ?: default as Boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getObject(key: String): JsonObject {
|
fun getObject(key: String): JsonObject {
|
||||||
|
@ -75,7 +75,14 @@ internal object SendMessage: IActionHandler() {
|
|||||||
// return logic("contact is not found", echo = echo)
|
// return logic("contact is not found", echo = echo)
|
||||||
//}
|
//}
|
||||||
val result = if (autoEscape) {
|
val result = if (autoEscape) {
|
||||||
MsgSvc.sendToAio(chatType, peerId, arrayListOf(message).json, fromId = fromId)
|
MsgSvc.sendToAio(chatType, peerId, listOf(
|
||||||
|
mapOf(
|
||||||
|
"type" to "text",
|
||||||
|
"data" to mapOf(
|
||||||
|
"text" to message
|
||||||
|
)
|
||||||
|
)
|
||||||
|
).json, fromId = fromId)
|
||||||
} else {
|
} else {
|
||||||
val msg = MessageHelper.decodeCQCode(message)
|
val msg = MessageHelper.decodeCQCode(message)
|
||||||
if (msg.isEmpty()) {
|
if (msg.isEmpty()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user