diff --git a/packages/onebot/src/media-store.ts b/packages/onebot/src/media-store.ts index e46d91c1..23d95378 100644 --- a/packages/onebot/src/media-store.ts +++ b/packages/onebot/src/media-store.ts @@ -298,8 +298,8 @@ function foldMediaKey(value: string): string { return `inline:${createHash('sha256').update(value).digest('hex')}`; } -function persistableMediaInfo(info: T): T { - const next = { ...info } as T & Record; +function persistableMediaInfo(info: object): Record { + const next: Record = { ...info }; for (const field of ['file', 'fileId', 'fileName'] as const) { const value = next[field]; if (typeof value === 'string') next[field] = foldMediaKey(value);