mirror of
https://github.com/chrononeko/chronocat.git
synced 2024-11-29 02:57:17 +00:00
feat: support facebubble
This commit is contained in:
parent
94f5f5da00
commit
30229d65aa
@ -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')
|
||||
|
||||
|
@ -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<Element, 'deep'> => ({
|
||||
elementType: 27,
|
||||
elementId: '',
|
||||
faceBubbleElement: {
|
||||
faceType: id,
|
||||
faceCount: count || 1,
|
||||
faceSummary: summary || '',
|
||||
faceFlag: 0,
|
||||
content: content || `[${summary}]x${count}`,
|
||||
oldVersionStr: '',
|
||||
},
|
||||
}),
|
||||
|
||||
pcPoke: (pokeType: number): O.Partial<Element, 'deep'> => ({
|
||||
elementId: '0',
|
||||
elementType: 6,
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user