- Wechaty
Wechaty: Wechat for ChatBots. Connect ChatBots
Class Wechaty
Licenst: ISC https://github.com/zixia/wechaty
Example
// The World's Shortest ChatBot Code: 6 lines of JavaScript const { Wechaty } = require('wechaty')
Wechaty.instance() // Singleton .on('scan', (url, code) => console.log(
Scan QR Code to login: ${code}\n${url}
)) .on('login', user => console.log(User ${user} logined
)) .on('message', message => console.log(Message: ${message}
)) .init()- Room
wechaty: Wechat for Bot. and for human who talk to bot/robot
Licenst: ISC https://github.com/zixia/wechaty
Add/Del/Topic: wechaty#32
- Contact
Class Contact blabla... IMPORTANT
- config_1
Wechaty: Wechaty - Wechat for Bot. Connecting ChatBots
Licenst: ISC https://github.com/wechaty/wechaty
Wechaty: Wechat for ChatBots. Connect ChatBots
Class Wechaty
Licenst: ISC https://github.com/zixia/wechaty
Example
// The World's Shortest ChatBot Code: 6 lines of JavaScript
const { Wechaty } = require('wechaty')
Wechaty.instance() // Singleton
.on('scan', (url, code) => console.log(`Scan QR Code to login: ${code}\n${url}`))
.on('login', user => console.log(`User ${user} logined`))
.on('message', message => console.log(`Message: ${message}`))
.init()
Kind: global class
See: The Wechaty Starter Project
Return version of Wechaty
Kind: instance method of Wechaty
Returns: string
- - the version number
Param | Type | Default | Description |
---|---|---|---|
[forceNpm] | boolean |
false |
if set to true, will only return the version in package.json. otherwise will return git commit hash if .git exists. |
Example
console.log(Wechaty.instance().version())
// '#git[af39df]'
console.log(Wechaty.instance().version(true))
// '0.7.9'
wechaty.user() ⇒ Contact
Contact
Deprecated
Kind: instance method of Wechaty
Todo
- document me
Kind: instance method of Wechaty
Todo
- document me
Kind: instance method of Wechaty
Todo
- document me
Kind: instance method of Wechaty
Todo
- document me
Kind: instance method of Wechaty
Todo
- document me
wechaty.self() ⇒ Contact
get current user
Kind: instance method of Wechaty
Returns: Contact
- current logined user
Kind: instance method of Wechaty
Todo
- document me
Kind: instance method of Wechaty
Todo
- document me
Kind: instance method of Wechaty
Todo
- document me
get the singleton instance of Wechaty
Kind: static method of Wechaty
wechaty: Wechat for Bot. and for human who talk to bot/robot
Licenst: ISC https://github.com/zixia/wechaty
Add/Del/Topic: wechaty#32
Kind: static method of Room
Todo
- document me
Class Contact blabla... IMPORTANT
Kind: global class
- Contact
- instance
- static
Contact gender
Kind: instance method of Contact
Returns: Gender.Male(2) | Gender.Female(1) | Gender.Unknown(0)
Get avatar picture file stream
Kind: instance method of Contact
find contact by name
or alias
Kind: static method of Contact
try to find a contact by filter: {name: string | RegExp}
Kind: static method of Contact
Wechaty: * * Wechaty - Wechat for Bot. Connecting ChatBots
Licenst: ISC https://github.com/wechaty/wechaty
Kind: global constant