fix onebot video file sending

This commit is contained in:
DrSmoothl committed 2026-05-11 23:26:45 +08:00
1 parent e917720d9d
commit 6f506ff52c
8 files changed
+145 -48

No files matched your search

@@ -108,6 +108,14 @@ describe('parseMessage', () => {
expect(result).toEqual([{ type: 'video', url: '/tmp/clip.mp4', thumbUrl: '/tmp/clip.png' }]);
});
it('parses AstrBot-style Video segment with top-level media', async () => {
const result = await parseMessage(
[{ type: 'Video', media: 'file:////AstrBot/data/cache/BV-test.mp4' }] as any,
false,
);
expect(result).toEqual([{ type: 'video', url: 'file:////AstrBot/data/cache/BV-test.mp4', thumbUrl: undefined }]);
});
it('drops video segment with empty source', async () => {
const result = await parseMessage(
[{ type: 'video', data: {} }] as any,