Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add api to explain which belongs to web API, which belongs to padchat API, which belongs… #1486

Merged
merged 7 commits into from
Jul 20, 2018
Merged
12 changes: 11 additions & 1 deletion src/user/contact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ export const POOL = Symbol('pool')

/**
* All wechat contacts(friend) will be encapsulated as a Contact.
*
* [Examples/Contact-Bot]{@link https://github.com/Chatie/wechaty/blob/1523c5e02be46ebe2cc172a744b2fbe53351540e/examples/contact-bot.ts}
*
* @property {string} id - Get Contact id.
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
*/
export class Contact extends Accessory implements Sayable {

Expand Down Expand Up @@ -73,6 +75,8 @@ export class Contact extends Accessory implements Sayable {
*/
/**
* Get Contact by id
* > Tips:
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
*
* @static
* @param {string} id
Expand Down Expand Up @@ -307,6 +311,9 @@ export class Contact extends Accessory implements Sayable {
public async say(contact: Contact) : Promise<void>

/**
* > Tips:
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
*
* @param {(string | Contact | FileBox)} textOrContactOrFile
* send text, Contact, or file to contact. </br>
* You can use {@link https://www.npmjs.com/package/file-box|FileBox} to send file
Expand Down Expand Up @@ -451,6 +458,9 @@ export class Contact extends Accessory implements Sayable {
/**
* Check if contact is friend
*
* > Tips:
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
*
* @returns {boolean | null}
*
* <br>True for friend of the bot <br>
Expand Down
6 changes: 6 additions & 0 deletions src/user/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ export class Message extends Accessory implements Sayable {

/**
* Reply a Text or Media File message to the sender.
* > Tips:
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
*
* @see {@link https://github.com/Chatie/wechaty/blob/1523c5e02be46ebe2cc172a744b2fbe53351540e/examples/ding-dong-bot.ts|Examples/ding-dong-bot}
* @param {(string | Contact | FileBox)} textOrContactOrFile
Expand Down Expand Up @@ -742,6 +744,8 @@ export class Message extends Accessory implements Sayable {

/**
* Extract the Media File from the Message, and put it into the FileBox.
* > Tips:
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
*
* @returns {Promise<FileBox>}
*/
Expand All @@ -756,6 +760,8 @@ export class Message extends Accessory implements Sayable {
/**
* Get Share Card of the Message
* Extract the Contact Card from the Message, and encapsulate it into Contact class
* > Tips:
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
* @returns {Promise<Contact>}
*/
public async toContact(): Promise<Contact> {
Expand Down
28 changes: 26 additions & 2 deletions src/user/room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ import {
* All wechat rooms(groups) will be encapsulated as a Room.
*
* [Examples/Room-Bot]{@link https://github.com/Chatie/wechaty/blob/1523c5e02be46ebe2cc172a744b2fbe53351540e/examples/room-bot.ts}
*
* @property {string} id - Get Room id.
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
*/
export class Room extends Accessory implements Sayable {

Expand Down Expand Up @@ -220,6 +223,7 @@ export class Room extends Accessory implements Sayable {
* 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)
* @static
* @param {string} id
* @returns {Room}
Expand Down Expand Up @@ -354,6 +358,8 @@ export class Room extends Accessory implements Sayable {

/**
* Send message inside Room, if set [replyTo], wechaty will mention the contact as well.
* > Tips:
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
*
* @param {(string | Contact | FileBox)} textOrContactOrFile - Send `text` or `media file` inside Room. <br>
* You can use {@link https://www.npmjs.com/package/file-box|FileBox} to send file
Expand Down Expand Up @@ -513,6 +519,11 @@ export class Room extends Accessory implements Sayable {
/**
* Add contact in a room
*
* > Tips:
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
* >
* > see {@link https://github.com/Chatie/wechaty/issues/1441|Web version of WeChat closed group interface}
*
* @param {Contact} contact
* @returns {Promise<void>}
* @example
Expand All @@ -537,6 +548,12 @@ export class Room extends Accessory implements Sayable {
/**
* Delete a contact from the room
* It works only when the bot is the owner of the room
*
* > Tips:
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
* >
* > see {@link https://github.com/Chatie/wechaty/issues/1441|Web version of WeChat closed group interface}
*
* @param {Contact} contact
* @returns {Promise<void>}
* @example
Expand Down Expand Up @@ -576,6 +593,9 @@ export class Room extends Accessory implements Sayable {
/**
* Bot quit the room itself
*
* > Tips:
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
*
* @returns {Promise<void>}
* @example
* await room.quit()
Expand Down Expand Up @@ -661,6 +681,8 @@ export class Room extends Accessory implements Sayable {
/**
* SET/GET announce from the room
* > Tips: It only works when bot is the owner of the room.
* >
* > This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
*
* @param {string} [text] If set this para, it will change room announce.
* @returns {(Promise<void | string>)}
Expand Down Expand Up @@ -694,7 +716,8 @@ export class Room extends Accessory implements Sayable {

/**
* Get QR Code of the Room from the room, which can be used as scan and join the room.
*
* > Tips:
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
* @returns {Promise<string>}
*/
public async qrcode(): Promise<string> {
Expand Down Expand Up @@ -911,7 +934,8 @@ export class Room extends Accessory implements Sayable {

/**
* Get room's owner from the room.
*
* > Tips:
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
* @returns {(Contact | null)}
* @example
* const owner = room.owner()
Expand Down
4 changes: 4 additions & 0 deletions src/wechaty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1008,9 +1008,13 @@ export class Wechaty extends Accessory implements Sayable {

/**
* Send message to userSelf, in other words, bot send message to itself.
* > Tips:
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/Chatie/wechaty/wiki/Puppet#3-puppet-compatible-table)
*
* @param {(string | Contact | FileBox)} textOrContactOrFile
* send text, Contact, or file to bot. </br>
* You can use {@link https://www.npmjs.com/package/file-box|FileBox} to send file
*
* @returns {Promise<void>}
*
* @example
Expand Down