| query | [<code>RoomMemberQueryFilter</code>](#RoomMemberQueryFilter)\|<code>string</code> | When use memberAll(name:string), return all matched members, including name, roomAlias, contactAlias |
| [query] | [<code>RoomMemberQueryFilter</code>](#RoomMemberQueryFilter)\|<code>string</code> | Optional parameter, When use memberAll(name:string), return all matched members, including name, roomAlias, contactAlias |
> Tips: For Web solution, it cannot get the unique topic id,
but for other solutions besides web,
we can get unique and permanent topic id.
This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
**Kind**: static method of [<code>Room</code>](#Room)
| Param | Type |
| --- | --- |
| id | <code>string</code> |
**Example**
```js
constbot=newWechaty()
awaitbot.start()
// after logged in...
constroom=bot.Room.load('roomId')
```
<aname="Contact"></a>
## Contact
...
...
@@ -928,7 +900,6 @@ All wechat contacts(friend) will be encapsulated as a Contact.
This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
**Kind**: static method of [<code>Contact</code>](#Contact)
**Kind**: instance method of [<code>RoomInvitation</code>](#RoomInvitation)
<aname="PuppetName"></a>
<aname="RoomInvitation+age"></a>
### roomInvitation.age() ⇒ <code>number</code>
Returns the roopm invitation age in seconds. <br>
For example, the invitation is sent at time `8:43:01`,
and when we received it in Wechaty, the time is `8:43:15`,
then the age() will return `8:43:15 - 8:43:01 = 14 (seconds)`
**Kind**: instance method of [<code>RoomInvitation</code>](#RoomInvitation)
<aname="PuppetModuleName"></a>
## PuppetName
## PuppetModuleName
The term [Puppet](https://github.com/Chatie/wechaty/wiki/Puppet) in Wechaty is an Abstract Class for implementing protocol plugins.
The plugins are the component that helps Wechaty to control the Wechat(that's the reason we call it puppet).
The plugins are named XXXPuppet, for example:
...
...
@@ -1798,10 +1774,11 @@ The plugins are named XXXPuppet, for example:
| Name | Type | Description |
| --- | --- | --- |
| wechat4u | <code>string</code> | The default puppet, using the [wechat4u](https://github.com/nodeWechat/wechat4u) to control the [WeChat Web API](https://wx.qq.com/) via a chrome browser. |
| padchat | <code>string</code> | - Using the WebSocket protocol to connect with a Protocol Server for controlling the iPad Wechat program. |
| puppeteer | <code>string</code> | - Using the [google puppeteer](https://github.com/GoogleChrome/puppeteer) to control the [WeChat Web API](https://wx.qq.com/) via a chrome browser. |
| mock | <code>string</code> | - Using the mock data to mock wechat operation, just for test. |
| PUPPET_DEFAULT | <code>string</code> | The default puppet. |
| wechaty-puppet-wechat4u | <code>string</code> | The default puppet, using the [wechat4u](https://github.com/nodeWechat/wechat4u) to control the [WeChat Web API](https://wx.qq.com/) via a chrome browser. |
| wechaty-puppet-padchat | <code>string</code> | - Using the WebSocket protocol to connect with a Protocol Server for controlling the iPad Wechat program. |
| wechaty-puppet-puppeteer | <code>string</code> | - Using the [google puppeteer](https://github.com/GoogleChrome/puppeteer) to control the [WeChat Web API](https://wx.qq.com/) via a chrome browser. |
| wechaty-puppet-mock | <code>string</code> | - Using the mock data to mock wechat operation, just for test. |
<aname="WechatyOptions"></a>
...
...
@@ -1813,8 +1790,8 @@ The option parameter to create a wechaty instance
| Name | Type | Description |
| --- | --- | --- |
| profile | <code>string</code> | Wechaty Name. </br> When you set this: </br>`new Wechaty({profile: 'wechatyName'}) `</br> it will generate a file called `wechatyName.memory-card.json`. </br> This file stores the bot's login information. </br> If the file is valid, the bot can auto login so you don't need to scan the qrcode to login again. </br> Also, you can set the environment variable for `WECHATY_PROFILE` to set this value when you start. </br> eg: `WECHATY_PROFILE="your-cute-bot-name" node bot.js` |
| puppet | <code>PuppetModuleName</code>\|<code>Puppet</code> | Puppet name or instance |
| profile | <code>string</code> | Wechaty Name. </br> When you set this: </br>`new Wechaty({profile: 'wechatyName'}) `</br> it will generate a file called `wechatyName.memory-card.json`. </br> This file stores the bot's login information. </br> If the file is valid, the bot can auto login so you don't need to scan the qrcode to login again. </br> Also, you can set the environment variable for `WECHATY_NAME` to set this value when you start. </br> eg: `WECHATY_NAME="your-cute-bot-name" node bot.js` |
| puppet | [<code>PuppetModuleName</code>](#PuppetModuleName)\|<code>Puppet</code> | Puppet name or instance |
| login | <code>string</code> | After the bot login full successful, the event login will be emitted, with a Contact of current logined user. |
| logout | <code>string</code> | Logout will be emitted when bot detected log out, with a Contact of the current login user. |
| heartbeat | <code>string</code> | Get bot's heartbeat. |
| friend | <code>string</code> | When someone sends you a friend request, there will be a Wechaty friend event fired. |
| friendship | <code>string</code> | When someone sends you a friend request, there will be a Wechaty friendship event fired. |
| message | <code>string</code> | Emit when there's a new message. |
| ready | <code>string</code> | Emit when all data has load completed, in wechaty-puppet-padchat, it means it has sync Contact and Room completed |
| room-join | <code>string</code> | Emit when anyone join any room. |
| room-topic | <code>string</code> | Get topic event, emitted when someone change room topic. |
| room-leave | <code>string</code> | Emit when anyone leave the room.<br> |
| room-invite | <code>string</code> | Emit when there is a room invitation, see more in [RoomInvitation](#RoomInvitation) If someone leaves the room by themselves, wechat will not notice other people in the room, so the bot will never get the "leave" event. |
| room-leave | <code>string</code> | Emit when anyone leave the room.<br> - If someone leaves the room by themselves, wechat will not notice other people in the room, so the bot will never get the "leave" event. |
| room-invite | <code>string</code> | Emit when there is a room invitation, see more in [RoomInvitation](#RoomInvitation) |
| scan | <code>string</code> | A scan event will be emitted when the bot needs to show you a QR Code for scanning. </br> It is recommend to install qrcode-terminal(run `npm install qrcode-terminal`) in order to show qrcode in the terminal. |