feat: New face

This commit is contained in:
linyuchen 2024-05-15 18:47:38 +08:00
parent 2e225045e6
commit 1489c6df25
5 changed files with 3688 additions and 10 deletions

View File

@ -7,7 +7,7 @@ import path from 'node:path'
import { selfInfo } from './data'
import { DATA_DIR } from './utils'
export const HOOK_LOG = true
export const HOOK_LOG = false
export const ALLOW_SEND_TEMP_MSG = false

View File

@ -2,7 +2,6 @@ import {
AtType,
ElementType,
FaceIndex,
FaceType,
PicType,
SendArkElement,
SendFaceElement,
@ -22,6 +21,7 @@ import { log } from '../common/utils/log'
import { defaultVideoThumb, getVideoInfo } from '../common/utils/video'
import { encodeSilk } from '../common/utils/audio'
import { isNull } from '../common/utils'
import faceConfig from './face_config.json';
export const mFaceCache = new Map<string, string>() // emojiId -> faceName
@ -265,13 +265,30 @@ export class SendMsgElementConstructor {
}
static face(faceId: number): SendFaceElement {
// 从face_config.json中获取表情名称
const sysFaces = faceConfig.sysface
const emojiFaces = faceConfig.emoji
const face = sysFaces.find((face) => face.QSid === faceId.toString())
faceId = parseInt(faceId.toString())
// let faceType = parseInt(faceId.toString().substring(0, 1));
let faceType = 1
if (faceId >= 222){
faceType = 2
}
if (face.AniStickerType){
faceType = 3;
}
return {
elementType: ElementType.FACE,
elementId: '',
faceElement: {
faceIndex: faceId,
faceType: faceId < 222 ? FaceType.normal : FaceType.normal2,
faceType,
faceText: face.QDes,
stickerId: face.AniStickerId,
stickerType: face.AniStickerType,
packId: face.AniStickerPackId,
sourceType: 1,
},
}
}
@ -298,7 +315,7 @@ export class SendMsgElementConstructor {
elementId: '',
faceElement: {
faceIndex: FaceIndex.dice,
faceType: FaceType.dice,
faceType: 3,
faceText: '[骰子]',
packId: '1',
stickerId: '33',

3665
src/ntqqapi/face_config.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -229,11 +229,6 @@ export interface GrayTipElement {
}
}
export enum FaceType {
normal = 1, // 小黄脸
normal2 = 2, // 新小黄脸, 从faceIndex 222开始
dice = 3, // 骰子
}
export enum FaceIndex {
dice = 358,
@ -242,7 +237,7 @@ export enum FaceIndex {
export interface FaceElement {
faceIndex: number
faceType: FaceType
faceType: number
faceText?: string
packId?: string
stickerId?: string

View File

@ -8,6 +8,7 @@
"allowJs": true,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"paths": {
"@/common/*": [