Commit 728ce407 authored by initialencounter's avatar initialencounter

修改session.elements

parent 5523c6c9
Pipeline #21596 passed with stages
in 3 minutes and 16 seconds
# koishi-plugin-adapter-wechaty # koishi-plugin-adapter-wechaty2
Koishi 微信适配器。 Koishi 微信适配器。
......
{ {
"name": "koishi-plugin-adapter-wechaty", "name": "koishi-plugin-adapter-wechaty-whisper",
"description": "Koishi 微信适配器。", "description": "Koishi 微信适配器。",
"version": "1.1.5", "version": "1.1.5",
"main": "dist/src/index.js", "main": "dist/src/index.js",
......
...@@ -89,22 +89,22 @@ export async function messageToElement( ...@@ -89,22 +89,22 @@ export async function messageToElement(
break; break;
case MessageType.Image: case MessageType.Image:
elements.push( elements.push(
await extractMessageURL(message, async (url, name) => await extractMessageURL(message, async () =>
segment.image(url, { file: await autoFilename(url) }), segment.image(await(await ( message.toFileBox())).toBuffer(), 'image/png'),
), ),
); );
break; break;
case MessageType.Audio: case MessageType.Audio:
elements.push( elements.push(
await extractMessageURL(message, async (url, name) => await extractMessageURL(message, async () =>
segment.audio(url, { file: await autoFilename(url) }), segment.audio(await(await ( message.toFileBox())).toBuffer(), 'audio/wav'),
), ),
); );
break; break;
case MessageType.Video: case MessageType.Video:
elements.push( elements.push(
await extractMessageURL(message, async (url, name) => await extractMessageURL(message, async () =>
segment.video(url, { file: await autoFilename(url) }), segment.video(await(await ( message.toFileBox())).toBuffer(), 'video/mp4'),
), ),
); );
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment