diff --git a/packages/engine-chronocat-api/src/api/message/create/messager.ts b/packages/engine-chronocat-api/src/api/message/create/messager.ts index 406db15..88d16f0 100644 --- a/packages/engine-chronocat-api/src/api/message/create/messager.ts +++ b/packages/engine-chronocat-api/src/api/message/create/messager.ts @@ -290,6 +290,18 @@ export class Messager { return } + case `${this.ctx.chronocat.platform}:facebubble`: { + this.children.push( + r.faceBubble( + Number(attrs['id']), + Number(attrs['count']), + attrs['name'] as string, + attrs['content'] as string, + ), + ) + return + } + case 'quote': { const [author] = this.ctx.chronocat.h.select(children, 'author') diff --git a/packages/engine-chronocat-api/src/api/message/create/r.ts b/packages/engine-chronocat-api/src/api/message/create/r.ts index 7580669..cedf3b6 100644 --- a/packages/engine-chronocat-api/src/api/message/create/r.ts +++ b/packages/engine-chronocat-api/src/api/message/create/r.ts @@ -1,4 +1,4 @@ -import type { Element, Peer, QFace } from '@chronocat/red' +import type { Element, FaceBubbleType, Peer, QFace } from '@chronocat/red' import { AtType, FaceType } from '@chronocat/red' import type { ChronocatContext } from '@chronocat/shell' import type { O } from 'ts-toolbelt' @@ -136,6 +136,24 @@ const b = () => { }, }), + faceBubble: ( + id: FaceBubbleType, + count?: number, + summary?: string, + content?: string, + ): O.Partial => ({ + elementType: 27, + elementId: '', + faceBubbleElement: { + faceType: id, + faceCount: count || 1, + faceSummary: summary || '', + faceFlag: 0, + content: content || `[${summary}]x${count}`, + oldVersionStr: '', + }, + }), + pcPoke: (pokeType: number): O.Partial => ({ elementId: '0', elementType: 6, diff --git a/packages/engine-chronocat-event/src/parser/index.ts b/packages/engine-chronocat-event/src/parser/index.ts index 2a9839d..4e3ef15 100644 --- a/packages/engine-chronocat-event/src/parser/index.ts +++ b/packages/engine-chronocat-event/src/parser/index.ts @@ -580,6 +580,18 @@ async function parseElements( break } + case 27: { + elements.push( + ctx.chronocat.h(`${ctx.chronocat.platform}:facebubble`, { + id: m.faceBubbleElement!.faceType, + count: m.faceBubbleElement!.faceCount, + name: m.faceBubbleElement!.faceSummary, + content: m.faceBubbleElement!.content, + }), + ) + break + } + default: break } diff --git a/packages/red/src/redEntity.ts b/packages/red/src/redEntity.ts index dbbeb90..f32c94a 100644 --- a/packages/red/src/redEntity.ts +++ b/packages/red/src/redEntity.ts @@ -284,11 +284,11 @@ export interface Element { videoElement?: VideoElement walletElement?: unknown yoloGameResultElement?: unknown - structMsgElement: unknown - faceBubbleElement: unknown - shareLocationElement: unknown - tofuRecordElement: unknown - taskTopMsgElement: unknown + structMsgElement?: unknown + faceBubbleElement?: FaceBubbleElement + shareLocationElement?: unknown + tofuRecordElement?: unknown + taskTopMsgElement?: unknown } export interface PicElement { @@ -400,6 +400,39 @@ export interface QFace { Input: string[] } +export interface FaceBubbleElement { + faceType: FaceBubbleType + faceCount: number + faceSummary: string // '平底锅' + faceFlag: number // 0 + content: string // '[平底锅]x1' + oldVersionStr: string // '' + others: unknown + yellowFaceInfo: unknown +} + +export enum FaceBubbleType { + /** + * 榴莲 + */ + Liulian = 9, + + /** + * 略略略 + */ + LveLveLve = 10, + + /** + * 平底锅 + */ + Pingdiguo = 11, + + /** + * 钞票 + */ + Chaopiao = 12, +} + export interface FileElement { fileMd5: string fileName: string