diff --git a/examples/advanced/self-testing-bot.js b/examples/advanced/self-testing-bot.js index 30e6a57..ead41fa 100644 --- a/examples/advanced/self-testing-bot.js +++ b/examples/advanced/self-testing-bot.js @@ -27,10 +27,8 @@ const { log, } = require('wechaty') -const BOT_QR_CODE_IMAGE_FILE = path.resolve( - __dirname, - '../docs/images/bot-qr-code.png', -) +const BOT_QR_CODE_IMAGE_FILE_BOX = FileBox + .fromUrl('https://wechaty.js.org/img/friday-qrcode.svg') const bot = Wechaty.instance() @@ -198,14 +196,13 @@ bot /** * 2. reply qrcode image */ - 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, // ) - log.info('Bot', 'REPLY: %s', fileBox) - await msg.say(fileBox) + log.info('Bot', 'REPLY: %s', BOT_QR_CODE_IMAGE_FILE_BOX) + await msg.say(BOT_QR_CODE_IMAGE_FILE_BOX) /** * 3. reply 'scan now!' diff --git a/examples/basic/ding-dong-bot.js b/examples/basic/ding-dong-bot.js index f8e4e91..2adccf1 100644 --- a/examples/basic/ding-dong-bot.js +++ b/examples/basic/ding-dong-bot.js @@ -30,8 +30,7 @@ const qrTerm = require('qrcode-terminal') * */ const bot = new Wechaty({ - profile : config.default.DEFAULT_PROFILE, - name : 'myWechatyBot', + name: 'myWechatyBot', }) /** @@ -132,7 +131,7 @@ async function onMessage (msg) { /** * 2. reply image(qrcode image) */ - const fileBox = FileBox.fromUrl('https://wechaty.github.io/wechaty/images/bot-qr-code.png') + const fileBox = FileBox.fromUrl('https://wechaty.js.org/img/friday-qrcode.svg') await msg.say(fileBox) console.log('REPLY: %s', fileBox.toString()) diff --git a/package.json b/package.json index a2b9877..d4e7701 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wechaty-getting-started", - "version": "0.4.74", + "version": "0.5.5", "description": "Wechaty conversational SDK getting start template & examples", "main": "examples/ding-dong-bot.js", "engines": {