mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
feat: test code
This commit is contained in:
parent
0cdb8cecbf
commit
b43b4ee5c0
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -209,6 +209,10 @@ const _handlers: {
|
||||
[OB11MessageDataType.xml]: () => undefined,
|
||||
|
||||
[OB11MessageDataType.poke]: () => undefined,
|
||||
|
||||
[OB11MessageDataType.Location]: async () => {
|
||||
return SendMsgElementConstructor.location();
|
||||
}
|
||||
};
|
||||
|
||||
const handlers = <{
|
||||
|
@ -59,7 +59,8 @@ export enum OB11MessageDataType {
|
||||
poke = 'poke',
|
||||
dice = 'dice',
|
||||
RPS = 'rps',
|
||||
miniapp = 'miniapp'//json类
|
||||
miniapp = 'miniapp',//json类
|
||||
Location = "Location"
|
||||
}
|
||||
|
||||
export interface OB11MessageMFace {
|
||||
|
Loading…
x
Reference in New Issue
Block a user