mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-16 04:45:46 +00:00
fix: custom music card content
This commit is contained in:
parent
f7307e8e01
commit
c521269409
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,7 @@
|
|||||||
# Develop
|
# Develop
|
||||||
node_modules/
|
node_modules/
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
pnpm-lock.yaml
|
||||||
out/
|
out/
|
||||||
dist/
|
dist/
|
||||||
src/core.lib/common/
|
src/core.lib/common/
|
||||||
|
@ -314,6 +314,11 @@ export async function createSendElements(messageData: OB11MessageData[], group:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const postData = { ...sendMsg.data } as IdMusicSignPostData | CustomMusicSignPostData;
|
||||||
|
if (sendMsg.data.type === 'custom' && sendMsg.data.content) {
|
||||||
|
(postData as CustomMusicSignPostData).singer = sendMsg.data.content;
|
||||||
|
delete (postData as OB11MessageCustomMusic['data']).content;
|
||||||
|
}
|
||||||
const musicMsgElement = await genMusicElement(sendMsg.data);
|
const musicMsgElement = await genMusicElement(sendMsg.data);
|
||||||
logDebug('生成音乐消息', musicMsgElement);
|
logDebug('生成音乐消息', musicMsgElement);
|
||||||
if (musicMsgElement) {
|
if (musicMsgElement) {
|
||||||
@ -321,7 +326,6 @@ export async function createSendElements(messageData: OB11MessageData[], group:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -212,7 +212,7 @@ export interface OB11MessageIdMusic {
|
|||||||
}
|
}
|
||||||
export interface OB11MessageCustomMusic {
|
export interface OB11MessageCustomMusic {
|
||||||
type: OB11MessageDataType.music
|
type: OB11MessageDataType.music
|
||||||
data: CustomMusicSignPostData
|
data: Omit<CustomMusicSignPostData, 'singer'> & { content?: string }
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface OB11MessageJson {
|
export interface OB11MessageJson {
|
||||||
|
Loading…
Reference in New Issue
Block a user