mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
Shamrock
: 支持篮球超表情, 新猜拳超表情
This commit is contained in:
parent
3a0dc41329
commit
5c10a5a04e
@ -99,6 +99,8 @@ internal object MessageMaker {
|
|||||||
"weather" to MessageMaker::createWeatherElem,
|
"weather" to MessageMaker::createWeatherElem,
|
||||||
"json" to MessageMaker::createJsonElem,
|
"json" to MessageMaker::createJsonElem,
|
||||||
"new_dice" to MessageMaker::createNewDiceElem,
|
"new_dice" to MessageMaker::createNewDiceElem,
|
||||||
|
"new_rps" to MessageMaker::createNewRpsElem,
|
||||||
|
"basketball" to MessageMaker::createBasketballElem,
|
||||||
//"node" to MessageMaker::createNodeElem,
|
//"node" to MessageMaker::createNodeElem,
|
||||||
//"multi_msg" to MessageMaker::createLongMsgStruct,
|
//"multi_msg" to MessageMaker::createLongMsgStruct,
|
||||||
)
|
)
|
||||||
@ -113,6 +115,55 @@ internal object MessageMaker {
|
|||||||
// SendForwardMessage(MsgConstant.KCHATTYPEC2C, TicketSvc.getUin(), data["content"].asJsonArray)
|
// SendForwardMessage(MsgConstant.KCHATTYPEC2C, TicketSvc.getUin(), data["content"].asJsonArray)
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
|
/**\
|
||||||
|
* msgElement.setFaceElement(new FaceElement());
|
||||||
|
* msgElement.getFaceElement().setFaceIndex(114);
|
||||||
|
* msgElement.getFaceElement().setFaceText("/篮球");
|
||||||
|
* msgElement.getFaceElement().setFaceType(3);
|
||||||
|
* msgElement.getFaceElement().setPackId("1");
|
||||||
|
* msgElement.getFaceElement().setStickerId("13");
|
||||||
|
* msgElement.getFaceElement().setRandomType(1);
|
||||||
|
* msgElement.getFaceElement().setImageType(1);
|
||||||
|
* msgElement.getFaceElement().setStickerType(2);
|
||||||
|
* msgElement.getFaceElement().setSourceType(1);
|
||||||
|
* msgElement.getFaceElement().setSurpriseId("");
|
||||||
|
* msgElement.getFaceElement().setResultId(String.valueOf(new Random().nextInt(5) + 1));
|
||||||
|
*/
|
||||||
|
private suspend fun createBasketballElem(chatType: Int, msgId: Long, peerId: String, data: JsonObject): Result<MsgElement> {
|
||||||
|
val elem = MsgElement()
|
||||||
|
elem.elementType = MsgConstant.KELEMTYPEFACE
|
||||||
|
val face = FaceElement()
|
||||||
|
face.faceIndex = 114
|
||||||
|
face.faceText = "/篮球"
|
||||||
|
face.faceType = 3
|
||||||
|
face.packId = "1"
|
||||||
|
face.stickerId = "13"
|
||||||
|
face.sourceType = 1
|
||||||
|
face.stickerType = 2
|
||||||
|
face.resultId = Random.nextInt(1 .. 5).toString()
|
||||||
|
face.surpriseId = ""
|
||||||
|
face.randomType = 1
|
||||||
|
elem.faceElement = face
|
||||||
|
return Result.success(elem)
|
||||||
|
}
|
||||||
|
|
||||||
|
private suspend fun createNewRpsElem(chatType: Int, msgId: Long, peerId: String, data: JsonObject): Result<MsgElement> {
|
||||||
|
val elem = MsgElement()
|
||||||
|
elem.elementType = MsgConstant.KELEMTYPEFACE
|
||||||
|
val face = FaceElement()
|
||||||
|
face.faceIndex = 359
|
||||||
|
face.faceText = "/包剪锤"
|
||||||
|
face.faceType = 3
|
||||||
|
face.packId = "1"
|
||||||
|
face.stickerId = "34"
|
||||||
|
face.sourceType = 1
|
||||||
|
face.stickerType = 2
|
||||||
|
face.resultId = ""
|
||||||
|
face.surpriseId = ""
|
||||||
|
face.randomType = 1
|
||||||
|
elem.faceElement = face
|
||||||
|
return Result.success(elem)
|
||||||
|
}
|
||||||
|
|
||||||
private suspend fun createNewDiceElem(chatType: Int, msgId: Long, peerId: String, data: JsonObject): Result<MsgElement> {
|
private suspend fun createNewDiceElem(chatType: Int, msgId: Long, peerId: String, data: JsonObject): Result<MsgElement> {
|
||||||
val elem = MsgElement()
|
val elem = MsgElement()
|
||||||
|
@ -55,21 +55,42 @@ internal sealed class MessageElemConverter: IMessageConvert {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (face.faceIndex == 358) {
|
|
||||||
if (face.sourceType == 1) return MessageSegment("new_dice")
|
|
||||||
return MessageSegment(
|
when (face.faceIndex) {
|
||||||
type = "new_dice",
|
114 -> {
|
||||||
|
return MessageSegment(
|
||||||
|
type = "basketball",
|
||||||
|
data = hashMapOf(
|
||||||
|
"id" to face.resultId.ifEmpty { "0" }.toInt(),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
358 -> {
|
||||||
|
if (face.sourceType == 1) return MessageSegment("new_dice")
|
||||||
|
return MessageSegment(
|
||||||
|
type = "new_dice",
|
||||||
|
data = hashMapOf(
|
||||||
|
"id" to face.resultId.ifEmpty { "0" }.toInt()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
359 -> {
|
||||||
|
if (face.resultId.isEmpty()) return MessageSegment("new_rps")
|
||||||
|
return MessageSegment(
|
||||||
|
type = "new_rps",
|
||||||
|
data = hashMapOf(
|
||||||
|
"id" to face.resultId.ifEmpty { "0" }.toInt()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
else -> return MessageSegment(
|
||||||
|
type = "face",
|
||||||
data = hashMapOf(
|
data = hashMapOf(
|
||||||
"id" to face.resultId.ifEmpty { "0" }.toInt()
|
"id" to face.faceIndex
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return MessageSegment(
|
|
||||||
type = "face",
|
|
||||||
data = hashMapOf(
|
|
||||||
"id" to face.faceIndex
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user