diff --git a/examples/self-testing-bot.ts b/examples/self-testing-bot.ts index a4d7ad5a6377ec94b67f4481a61a42af76751b39..141961f251c14a98626b8baa15951c6d02b3fb35 100644 --- a/examples/self-testing-bot.ts +++ b/examples/self-testing-bot.ts @@ -215,7 +215,7 @@ bot /** * 2. reply qrcode image */ - const fileBox = FileBox.fromLocal(BOT_QR_CODE_IMAGE_FILE) + const fileBox = FileBox.fromFile(BOT_QR_CODE_IMAGE_FILE) // const fileBox = FileBox.packStream( // fs.createReadStream(BOT_QR_CODE_IMAGE_FILE), // BOT_QR_CODE_IMAGE_FILE, diff --git a/package.json b/package.json index 25244ed628388c448cf3edf3d7bb5360cface6bb..79b47c806de0bc9fccfaf508aaddf7f8c6341baa 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "clone-class": "^0.6.11", "cuid": "^2.1.1", "express": "^4.16.3", - "file-box": "^0.8.14", + "file-box": "^0.8.19", "hot-import": "^0.2.1", "jimp": "^0.2.28", "jsqr": "^1.0.4", diff --git a/src/puppet-mock/puppet-mock.ts b/src/puppet-mock/puppet-mock.ts index 910a5b1361097595ff31f89200b351e94d6c836c..ec06984b3f23f79a4a932149e0ac996346abdf7a 100644 --- a/src/puppet-mock/puppet-mock.ts +++ b/src/puppet-mock/puppet-mock.ts @@ -157,7 +157,7 @@ export class PuppetMock extends Puppet { log.verbose('PuppetMock', 'contactAvatar(%s)', contactId) const WECHATY_ICON_PNG = path.resolve('../../docs/images/wechaty-icon.png') - return FileBox.fromLocal(WECHATY_ICON_PNG) + return FileBox.fromFile(WECHATY_ICON_PNG) } public async contactRawPayload(id: string): Promise { diff --git a/src/puppet-padchat/puppet-padchat.ts b/src/puppet-padchat/puppet-padchat.ts index bbe140ae5f2a108dc8b18b3b26db8ef2b31a3939..92dd84a0afa44362c89df582aa1cefb26a2d2846 100644 --- a/src/puppet-padchat/puppet-padchat.ts +++ b/src/puppet-padchat/puppet-padchat.ts @@ -368,7 +368,7 @@ export class PuppetPadchat extends Puppet { throw new Error('no avatar') } - const file = FileBox.fromRemote(payload.avatar) + const file = FileBox.fromUrl(payload.avatar) return file } diff --git a/src/puppet-puppeteer/puppet-puppeteer.ts b/src/puppet-puppeteer/puppet-puppeteer.ts index 70974e1b257c2f3810df1bb01ebaea3943373f81..52642d949789c672a2d3682fabdadcd0330b62ce 100644 --- a/src/puppet-puppeteer/puppet-puppeteer.ts +++ b/src/puppet-puppeteer/puppet-puppeteer.ts @@ -465,7 +465,7 @@ export class PuppetPuppeteer extends Puppet { Cookie: cookies.map(c => `${c['name']}=${c['value']}`).join('; '), } - const fileBox = FileBox.fromRemote(url, filename, headers) + const fileBox = FileBox.fromUrl(url, filename, headers) return fileBox } @@ -753,7 +753,7 @@ export class PuppetPuppeteer extends Puppet { // await contact.ready() const fileName = (payload.name || 'unknown') + '-avatar.jpg' - return FileBox.fromRemote( + return FileBox.fromUrl( avatarUrl, fileName, headers,