Files
getting-started/examples/advanced/shell-bot.ts
T
Huan LI (李卓桓) fb8358c636 add shell-bot
2020-08-29 22:33:30 +08:00

21 lines
351 B
TypeScript

import repl from 'repl'
import { Wechaty } from 'wechaty'
async function main () {
const wechaty = new Wechaty({
name: 'shell-bot',
})
console.info('Starting...')
await wechaty.start()
const shell = repl.start('wechaty> ')
shell.context.wechaty = wechaty
shell.on('exit', () => wechaty.stop())
}
main()
.catch(console.error)