diff --git a/examples/professional/blessed-twins-bot/README.md b/examples/professional/blessed-twins-bot/README.md index 76ee417..3a2c848 100644 --- a/examples/professional/blessed-twins-bot/README.md +++ b/examples/professional/blessed-twins-bot/README.md @@ -2,6 +2,13 @@ [![blessed twins bot](https://wechaty.github.io/wechaty/images/blessed-twins-bot.png)](https://asciinema.org/a/177857) +### How to run + +```bash +npm install blessed blessed-contrib @types/blessed +ts-node blessed-twins-bot.ts +``` + ### See Also * Example Source Code: diff --git a/examples/professional/blessed-twins-bot/bless-twins-bot.ts b/examples/professional/blessed-twins-bot/bless-twins-bot.ts index 352000a..5608a4c 100644 --- a/examples/professional/blessed-twins-bot/bless-twins-bot.ts +++ b/examples/professional/blessed-twins-bot/bless-twins-bot.ts @@ -8,7 +8,7 @@ import * as contrib from 'blessed-contrib' import { generate } from 'qrcode-terminal' import { - Wechaty, + Wechaty, WechatyOptions, } from 'wechaty' const screen = blessed.screen({ @@ -222,7 +222,7 @@ setInterval(function() { const text = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L'] const value = Math.round(Math.random() * 100) - lcdLineOne.setDisplay(value + text[value % 12]) + lcdLineOne.setDisplay(value + text[value % 12]!) lcdLineOne.setOptions({ color: colors[value % 5], elementPadding: 4, @@ -298,8 +298,8 @@ screen.render() * * */ -const boy = new Wechaty({ profile: 'boy' }) -const girl = new Wechaty({ profile: 'girl' }) +const boy = new Wechaty({ profile: 'boy' } as WechatyOptions) +const girl = new Wechaty({ profile: 'girl' } as WechatyOptions) startBot(boy, boyConsole) startBot(girl, girlConsole)