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 send urlLink example code #1750

Merged
merged 1 commit into from
Apr 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/user/contact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export class Contact extends Accessory implements Sayable {
* > 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)} textOrContactOrFileOrUrl
* @param {(string | Contact | FileBox | UrlLink)} textOrContactOrFileOrUrl
* send text, Contact, or file to contact. </br>
* You can use {@link https://www.npmjs.com/package/file-box|FileBox} to send file
* @returns {Promise<void>}
Expand All @@ -339,6 +339,16 @@ export class Contact extends Accessory implements Sayable {
*
* const contactCard = bot.Contact.load('contactId')
* await contact.say(contactCard)
*
* // 4. send url link to contact
*
* const urlLink = new UrlLink ({
* description: 'this is url link description',
* thumbnailUrl: 'this is a thumbnail url',
* title: 'this is url link title',
* url: 'this is the url',
* })
* await contact.say(urlLink)
*/
public async say (textOrContactOrFileOrUrl: string | Contact | FileBox | UrlLink): Promise<void> {
log.verbose('Contact', 'say(%s)', textOrContactOrFileOrUrl)
Expand Down