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 微信适配器。
......
{
"name": "koishi-plugin-adapter-wechaty",
"name": "koishi-plugin-adapter-wechaty-whisper",
"description": "Koishi 微信适配器。",
"version": "1.1.5",
"main": "dist/src/index.js",
......
......@@ -89,22 +89,22 @@ export async function messageToElement(
break;
case MessageType.Image:
elements.push(
await extractMessageURL(message, async (url, name) =>
segment.image(url, { file: await autoFilename(url) }),
await extractMessageURL(message, async () =>
segment.image(await(await ( message.toFileBox())).toBuffer(), 'image/png'),
),
);
break;
case MessageType.Audio:
elements.push(
await extractMessageURL(message, async (url, name) =>
segment.audio(url, { file: await autoFilename(url) }),
await extractMessageURL(message, async () =>
segment.audio(await(await ( message.toFileBox())).toBuffer(), 'audio/wav'),
),
);
break;
case MessageType.Video:
elements.push(
await extractMessageURL(message, async (url, name) =>
segment.video(url, { file: await autoFilename(url) }),
await extractMessageURL(message, async () =>
segment.video(await(await ( message.toFileBox())).toBuffer(), 'video/mp4'),
),
);
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