fix(examples): typescript errors of bless-twins-bot (#188)

This commit is contained in:
Jing Liu
2021-09-15 11:36:28 +08:00
committed by GitHub
parent 519768e0bb
commit 3d89f2fdfd
2 changed files with 11 additions and 4 deletions
@@ -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: <https://github.com/wechaty/wechaty-getting-started/tree/master/examples/professional/blessed-twins-bot>
@@ -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)