Open Nimbly8836 opened 2 months ago
Unofficial emoji message to fileBox error
In the file puppet-wechat4u.ts around line 675 under case PUPPET.types.Message.Emoticon, here is my solution:
puppet-wechat4u.ts
case PUPPET.types.Message.Emoticon
case PUPPET.types.Message.Emoticon: { /** * Emoji message */ const msg = await this.wechat4u.getMsgImg(rawPayload.MsgId) const fileExt = await getExtensionFromBuffer(msg.data) const ext = fileExt?.ext || 'jpg' filename = `${rawPayload.MsgId}.${ext}` const file = FileBox.fromBuffer( msg.data, filename, ) return file }
"dependencies": { "file-type": "^16.5.4" }, import { fromBuffer } from "file-type"; export async function getExtensionFromBuffer(buffer: Buffer) { return await fromBuffer(buffer) }
Unofficial emoji message to fileBox error
In the file
puppet-wechat4u.ts
around line 675 undercase PUPPET.types.Message.Emoticon
, here is my solution: