feat: test code

This commit is contained in:
手瓜一十雪
2024-07-12 16:59:08 +08:00
parent e1a9ef6512
commit fc00779202
4 changed files with 29 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ import {
SendPicElement,
SendPttElement,
SendReplyElement,
sendShareLocationElement,
SendTextElement,
SendVideoElement
} from './index';
@@ -27,6 +28,16 @@ export const mFaceCache = new Map<string, string>(); // emojiId -> faceName
export class SendMsgElementConstructor {
static location(): sendShareLocationElement {
return {
elementType: ElementType.ARK,
elementId: '',
shareLocationElement: {
text: "测试",
ext: ""
}
}
}
static text(content: string): SendTextElement {
return {
elementType: ElementType.TEXT,

View File

@@ -33,7 +33,8 @@ export enum ElementType {
GreyTip = 8,//Poke别叫戳一搓了 官方名字拍一拍 戳一戳是另一个名字
ARK = 10,
MFACE = 11,
MARKDOWN = 14
MARKDOWN = 14,
SHARELOCATION = 28
}
export interface SendTextElement {
@@ -120,6 +121,15 @@ export interface SendMarketFaceElement {
marketFaceElement: MarketFaceElement;
}
export interface sendShareLocationElement {
elementType: ElementType.ARK;
elementId: string;
shareLocationElement: {
text: string;
ext: string;
}
}
export interface FileElement {
fileMd5?: string;
fileName: string;
@@ -163,7 +173,7 @@ export interface SendMarkdownElement {
}
export type SendMessageElement = SendTextElement | SendPttElement |
SendPicElement | SendReplyElement | SendFaceElement | SendMarketFaceElement | SendFileElement | SendVideoElement | SendArkElement | SendMarkdownElement
SendPicElement | SendReplyElement | SendFaceElement | SendMarketFaceElement | SendFileElement | SendVideoElement | SendArkElement | SendMarkdownElement | sendShareLocationElement
export enum AtType {
notAt = 0,