fix: typo

This commit is contained in:
手瓜一十雪
2024-11-22 22:04:57 +08:00
parent 4277cb3f3c
commit 90b54435b5
4 changed files with 20 additions and 7 deletions

View File

@@ -15,6 +15,7 @@ import {
} from "@/core/packet/transformer/proto"; } from "@/core/packet/transformer/proto";
import { import {
BaseEmojiType, BaseEmojiType,
FaceType,
NTMsgAtType, NTMsgAtType,
PicType, PicType,
SendArkElement, SendArkElement,
@@ -163,7 +164,7 @@ export class PacketMsgFaceElement extends IPacketMsgElement<SendFaceElement> {
constructor(element: SendFaceElement) { constructor(element: SendFaceElement) {
super(element); super(element);
this.faceId = element.faceElement.faceIndex; this.faceId = element.faceElement.faceIndex;
this.isLargeFace = element.faceElement.faceType === BaseEmojiType.CHAIN_SUPER_EMOJI; this.isLargeFace = element.faceElement.faceType === FaceType.AniSticke;
} }
buildElement(): NapProtoEncodeStructType<typeof Elem>[] { buildElement(): NapProtoEncodeStructType<typeof Elem>[] {

View File

@@ -1,5 +1,4 @@
import { BaseEmojiType } from "./emoji"; import { ElementType, MessageElement, NTGrayTipElementSubTypeV2, PicSubType, PicType, TipAioOpGrayTipElement, TipGroupElement, NTVideoType, FaceType } from "./msg";
import { ElementType, MessageElement, NTGrayTipElementSubTypeV2, PicSubType, PicType, TipAioOpGrayTipElement, TipGroupElement, NTVideoType } from "./msg";
type ElementFullBase = Omit<MessageElement, 'elementType' | 'elementId' | 'extBufForUI'>; type ElementFullBase = Omit<MessageElement, 'elementType' | 'elementId' | 'extBufForUI'>;
@@ -31,7 +30,7 @@ export interface TextElement {
export interface FaceElement { export interface FaceElement {
faceIndex: number; faceIndex: number;
faceType: BaseEmojiType; faceType: FaceType;
faceText?: string; faceText?: string;
packId?: string; packId?: string;
stickerId?: string; stickerId?: string;
@@ -254,7 +253,7 @@ export interface FaceBubbleElement {
faceFlag: number; faceFlag: number;
content: string; content: string;
oldVersionStr: string; oldVersionStr: string;
faceType: BaseEmojiType; faceType: FaceType;
others: string; others: string;
yellowFaceInfo: { yellowFaceInfo: {
index: number; index: number;

View File

@@ -526,4 +526,16 @@ export interface MsgReqType {
includeSelf: boolean, includeSelf: boolean,
includeDeleteMsg: boolean, includeDeleteMsg: boolean,
extraCnt: number extraCnt: number
}
/**
* 表情类型枚举
*/
export enum FaceType {
Unknown = 0,
OldFace = 1, // 老表情
Normal = 2, // 常规表情
AniSticke = 3, // 动画贴纸
Lottie = 4,// 新格式表情
Poke = 5 // 可变Poke
} }

View File

@@ -16,6 +16,7 @@ import {
SendMessageElement, SendMessageElement,
SendTextElement, SendTextElement,
BaseEmojiType, BaseEmojiType,
FaceType,
} from '@/core'; } from '@/core';
import faceConfig from '@/core/external/face_config.json'; import faceConfig from '@/core/external/face_config.json';
import { NapCatOneBot11Adapter, OB11Message, OB11MessageData, OB11MessageDataType, OB11MessageFileBase, } from '@/onebot'; import { NapCatOneBot11Adapter, OB11Message, OB11MessageData, OB11MessageDataType, OB11MessageFileBase, } from '@/onebot';
@@ -547,7 +548,7 @@ export class OneBotMsgApi {
elementId: '', elementId: '',
faceElement: { faceElement: {
faceIndex: FaceIndex.DICE, faceIndex: FaceIndex.DICE,
faceType: BaseEmojiType.CHAIN_SUPER_EMOJI, faceType: FaceType.AniSticke,
faceText: '[骰子]', faceText: '[骰子]',
packId: '1', packId: '1',
stickerId: '33', stickerId: '33',
@@ -564,7 +565,7 @@ export class OneBotMsgApi {
faceElement: { faceElement: {
faceIndex: FaceIndex.RPS, faceIndex: FaceIndex.RPS,
faceText: '[包剪锤]', faceText: '[包剪锤]',
faceType: BaseEmojiType.CHAIN_SUPER_EMOJI, faceType: FaceType.AniSticke,
packId: '1', packId: '1',
stickerId: '34', stickerId: '34',
sourceType: 1, sourceType: 1,