diff --git a/.gitignore b/.gitignore index 1d58e147..a395f4da 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Develop node_modules/ package-lock.json +pnpm-lock.yaml out/ dist/ src/core.lib/common/ @@ -13,4 +14,4 @@ test # Build *.db -checkVersion.sh \ No newline at end of file +checkVersion.sh diff --git a/src/onebot11/action/msg/SendMsg.ts b/src/onebot11/action/msg/SendMsg.ts index baf4bd45..a81ea617 100644 --- a/src/onebot11/action/msg/SendMsg.ts +++ b/src/onebot11/action/msg/SendMsg.ts @@ -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 { diff --git a/src/onebot11/types.ts b/src/onebot11/types.ts index d0346c41..8918101e 100644 --- a/src/onebot11/types.ts +++ b/src/onebot11/types.ts @@ -212,7 +212,7 @@ export interface OB11MessageIdMusic { } export interface OB11MessageCustomMusic { type: OB11MessageDataType.music - data: CustomMusicSignPostData + data: Omit & { content?: string } } export interface OB11MessageJson {