mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
try send markdown
This commit is contained in:
parent
5a00d14f94
commit
22f74be4cd
@ -152,11 +152,9 @@ export async function createSendElements(messageData: OB11MessageData[], group:
|
|||||||
if (cache) {
|
if (cache) {
|
||||||
if (fs.existsSync(cache.path)) {
|
if (fs.existsSync(cache.path)) {
|
||||||
file = 'file://' + cache.path;
|
file = 'file://' + cache.path;
|
||||||
}
|
} else if (cache.url) {
|
||||||
else if (cache.url) {
|
|
||||||
file = cache.url;
|
file = cache.url;
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
const fileMsg = await dbUtil.getMsgByLongId(cache.msgId);
|
const fileMsg = await dbUtil.getMsgByLongId(cache.msgId);
|
||||||
if (fileMsg) {
|
if (fileMsg) {
|
||||||
const downloadPath = await NTQQFileApi.downloadMedia(fileMsg.msgId, fileMsg.chatType, fileMsg.peerUid,
|
const downloadPath = await NTQQFileApi.downloadMedia(fileMsg.msgId, fileMsg.chatType, fileMsg.peerUid,
|
||||||
@ -212,11 +210,17 @@ export async function createSendElements(messageData: OB11MessageData[], group:
|
|||||||
case OB11MessageDataType.dice: {
|
case OB11MessageDataType.dice: {
|
||||||
const resultId = sendMsg.data?.result;
|
const resultId = sendMsg.data?.result;
|
||||||
sendElements.push(SendMsgElementConstructor.dice(resultId));
|
sendElements.push(SendMsgElementConstructor.dice(resultId));
|
||||||
}break;
|
}
|
||||||
|
break;
|
||||||
case OB11MessageDataType.RPS: {
|
case OB11MessageDataType.RPS: {
|
||||||
const resultId = sendMsg.data?.result;
|
const resultId = sendMsg.data?.result;
|
||||||
sendElements.push(SendMsgElementConstructor.rps(resultId));
|
sendElements.push(SendMsgElementConstructor.rps(resultId));
|
||||||
}break;
|
}
|
||||||
|
break;
|
||||||
|
case OB11MessageDataType.markdown: {
|
||||||
|
const content = sendMsg.data?.content;
|
||||||
|
sendElements.push(SendMsgElementConstructor.markdown(content));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -335,8 +339,7 @@ export class SendMsg extends BaseAction<OB11PostSendMsg, ReturnDataType> {
|
|||||||
if (returnMsg) {
|
if (returnMsg) {
|
||||||
const msgShortId = await dbUtil.addMsg(returnMsg!, false);
|
const msgShortId = await dbUtil.addMsg(returnMsg!, false);
|
||||||
return { message_id: msgShortId };
|
return { message_id: msgShortId };
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
throw Error('发送转发消息失败');
|
throw Error('发送转发消息失败');
|
||||||
}
|
}
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
|
@ -229,13 +229,20 @@ export interface OB11MessageRPS{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface OB11MessageMarkdown {
|
||||||
|
type: OB11MessageDataType.markdown
|
||||||
|
data: {
|
||||||
|
content: string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export type OB11MessageData =
|
export type OB11MessageData =
|
||||||
OB11MessageText |
|
OB11MessageText |
|
||||||
OB11MessageFace | OB11MessageMFace |
|
OB11MessageFace | OB11MessageMFace |
|
||||||
OB11MessageAt | OB11MessageReply |
|
OB11MessageAt | OB11MessageReply |
|
||||||
OB11MessageImage | OB11MessageRecord | OB11MessageFile | OB11MessageVideo |
|
OB11MessageImage | OB11MessageRecord | OB11MessageFile | OB11MessageVideo |
|
||||||
OB11MessageNode | OB11MessageCustomMusic | OB11MessageJson |
|
OB11MessageNode | OB11MessageCustomMusic | OB11MessageJson |
|
||||||
OB11MessageDice | OB11MessageRPS
|
OB11MessageDice | OB11MessageRPS | OB11MessageMarkdown
|
||||||
|
|
||||||
export interface OB11PostSendMsg {
|
export interface OB11PostSendMsg {
|
||||||
message_type?: 'private' | 'group'
|
message_type?: 'private' | 'group'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user