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
|
||||
node_modules/
|
||||
package-lock.json
|
||||
pnpm-lock.yaml
|
||||
out/
|
||||
dist/
|
||||
src/core.lib/common/
|
||||
|
@ -314,6 +314,11 @@ export async function createSendElements(messageData: OB11MessageData[], group:
|
||||
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);
|
||||
logDebug('生成音乐消息', musicMsgElement);
|
||||
if (musicMsgElement) {
|
||||
@ -321,7 +326,6 @@ export async function createSendElements(messageData: OB11MessageData[], group:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -212,7 +212,7 @@ export interface OB11MessageIdMusic {
|
||||
}
|
||||
export interface OB11MessageCustomMusic {
|
||||
type: OB11MessageDataType.music
|
||||
data: CustomMusicSignPostData
|
||||
data: Omit<CustomMusicSignPostData, 'singer'> & { content?: string }
|
||||
}
|
||||
|
||||
export interface OB11MessageJson {
|
||||
|
Loading…
Reference in New Issue
Block a user