提交 6cbd7132 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

clean doc

上级 01ceceed
# Wechaty v0.19.4 Documentation
# Wechaty v0.19.5 Documentation
* <https://blog.chatie.io>
......@@ -116,7 +116,6 @@ See more:
* ~~[.self()](#Wechaty+self)~~
* [.userSelf()](#Wechaty+userSelf)<code>ContactSelf</code>
* [.say(textOrContactOrFile)](#Wechaty+say)<code>Promise.&lt;void&gt;</code>
* [.version([forceNpm])](#Wechaty+version)<code>string</code>
* _static_
* [.instance([options])](#Wechaty.instance)
......@@ -353,23 +352,6 @@ import { FileBox } from 'file-box'
const fileBox = FileBox.fromLocal('/tmp/text.jpg')
await bot.say(fileBox)
```
<a name="Wechaty+version"></a>
### wechaty.version([forceNpm]) ⇒ <code>string</code>
Return version of Wechaty
**Kind**: instance method of [<code>Wechaty</code>](#Wechaty)
**Returns**: <code>string</code> - - the version number
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| [forceNpm] | <code>boolean</code> | <code>false</code> | If set to true, will only return the version in package.json. </br> Otherwise will return git commit hash if .git exists. |
**Example**
```js
console.log(Wechaty.instance().version()) // return '#git[af39df]'
console.log(Wechaty.instance().version(true)) // return '0.7.9'
```
<a name="Wechaty.instance"></a>
### Wechaty.instance([options])
......
......@@ -180,14 +180,14 @@ export class Wechaty extends Accessory implements Sayable {
public readonly Room : typeof Room
/**
* get the singleton instance of Wechaty
* Get the global instance of Wechaty
*
* @param {WechatyOptions} [options={}]
*
* @example <caption>The World's Shortest ChatBot Code: 6 lines of JavaScript</caption>
* const { Wechaty } = require('wechaty')
*
* Wechaty.instance() // Singleton
* Wechaty.instance() // Global instance
* .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}`))
......@@ -1007,7 +1007,7 @@ export class Wechaty extends Accessory implements Sayable {
/**
* @description
* Should use {@link Wechaty#userSelf} instead
* @deprecated
* @deprecated Use `userSelf()` instead
*/
public self(): Contact {
log.warn('Wechaty', 'self() DEPRECATED. use userSelf() instead.')
......@@ -1086,6 +1086,7 @@ export class Wechaty extends Accessory implements Sayable {
}
/**
* @private
* Return version of Wechaty
*
* @param {boolean} [forceNpm=false] - If set to true, will only return the version in package.json. </br>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册