Files
Huan (李卓桓) 772f79dba0 code clean
2021-11-10 20:50:19 +08:00

21 lines
360 B
TypeScript

import repl from 'repl'
import { Wechaty } from 'wechaty'
async function main () {
const wechaty = WechatyBuilder.build({
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)