mirror of
https://github.com/wechaty/getting-started.git
synced 2026-10-18 14:34:32 +08:00
21 lines
360 B
TypeScript
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)
|