-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
add send urlLink example code in room class #1752
Conversation
There was a problem hiding this 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', |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, got it.
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 |
@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. |
OK, I will pay attention to this next time. |
There was a problem hiding this 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.
Thank you very much for making the documentation better by adding the missing example! |
When I follow the doc's example:
When i use "await contact.say(urlLink)", this error happen
My be the way i use new UrlLink(payload) is wrong ? I have read the Source Code, But found nothing to resolve this problem. |
|
refer #1751