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 in room class #1752

Merged

Conversation

linyimin0812
Copy link
Contributor

refer #1751

Copy link
Member

@huan huan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please get approvement from @windmemory first after you submit any PR in the furure, for making sure the PR quality is good before my review.

Thank you very much.

src/user/room.ts Outdated
*
* const urlLink = new UrlLink ({
* description : 'this is url link description',
* thumbnailUrl : 'this is a thumbnail url',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the example more specific and meaningful.

thumbnailUrl in the code should be a specific URL instead of a dummy text.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, got it.

@windmemory
Copy link
Member

Let's use below code as example, should be better I think

  /**
   * @example
   * // 6. send url link in a room
   *
   * const urlLink = new UrlLink ({
   *   description  : 'Welcome to Wechaty',
   *   thumbnailUrl : 'https://camo.githubusercontent.com/f310a2097d4aa79d6db2962fa42bb3bb2f6d43df/68747470733a2f2f6368617469652e696f2f776563686174792f696d616765732f776563686174792d6c6f676f2d656e2e706e67',
   *   title        : 'Wechaty',
   *   url          : 'https://github.com/chatie/wechaty',
   * })
   * await room.say(urlLink)
   */

What do you think @huan

@huan
Copy link
Member

huan commented Apr 22, 2019

@windmemory Looks good to me.

@linyimin-bupt Please do not close a PR without any reason or explanation. If you want to improve a PR, continue working on it instead of closing it and creating a new one.

@linyimin0812
Copy link
Contributor Author

OK, I will pay attention to this next time.

@linyimin0812 linyimin0812 reopened this Apr 22, 2019
Copy link
Member

@windmemory windmemory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

content looks good to me, but the indentation should be two spaces instead of one. This needs to be fixed.

@huan
Copy link
Member

huan commented Apr 24, 2019

Thank you very much for making the documentation better by adding the missing example!

@huan huan merged commit ab766e6 into wechaty:master Apr 24, 2019
@zeeklog
Copy link

zeeklog commented May 13, 2019

When I follow the doc's example:

const urlLink = new UrlLink ({
	description: 'Welcome to Wechaty',
	thumbnailUrl: 'https://camo.githubusercontent.com/f310a2097d4aa79d6db2962fa42bb3bb2f6d43df/68747470733a2f2f6368617469652e696f2f776563686174792f696d616765732f776563686174792d6c6f676f2d656e2e706e67',
	title: 'Wechaty',
	url: 'https://github.com/chatie/wechaty',
})
console.log(UrlLink)
await contact.say(urlLink)

When i use "await contact.say(urlLink)", this error happen

`[Function: UrlLink]
Error: Wechaty Puppet Unsupported API Error. Learn More At https://github.com/Chatie/wechaty-puppet/wiki/Compatibility
    at Object.throwUnsupportedError (\wechatMaopa\node_modules\_wechaty-puppet@0.15.7@wechaty-puppet\dist\src\throw-unsupported-error.js:4:11)`

My be the way i use new UrlLink(payload) is wrong ?

I have read the Source Code, But found nothing to resolve this problem.

@linyimin0812
Copy link
Contributor Author

wechaty-puppet-puppeteer puppet is no support messageSendUrl(), you should try it with wechaty-puppet-padchat or wechaty-puppet-padpro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants