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

feat: add receive and send link #1539

Closed
huan opened this issue Aug 10, 2018 · 3 comments
Closed

feat: add receive and send link #1539

huan opened this issue Aug 10, 2018 · 3 comments

Comments

@huan
Copy link
Member

huan commented Aug 10, 2018

Moved from #1538 , author: @windmemory

This is a prototype of dealing with link message.

My proposal design here is adding another field in the message, which is linkPayload, and store the content inside it. And when user want to send link message, then can say the linkPayload, then wechaty will send a link message.

link

The structure of the linkPayload is below, refer to the screenshot above

export interface LinkPayload {
  des?: string,
  thumburl?: string
  title: string,
  url: string,
}

The reason I didn't combine other card with link is that I found different type of card has different properties, if we put them all together, and leave some property as optional, it might cause confusion, so I added the specific payload for link.

In this change, I just implemented the Message.say(), since Contact or Room's say() method are similar to each other.

@zixia
Please let me know your thought about this implementation. And I used Amazon cloud9 environment this time, here is the link

I've sent out an invitation email to you, please use that credential to access the cloud9. Let me know if you can not access the cloud9.

huan added a commit to wechaty/puppet that referenced this issue Aug 10, 2018
huan pushed a commit to wechaty/puppet that referenced this issue Aug 10, 2018
* add receive and send link prototype

* refactor UrlPayload related code to support wechaty/wechaty#1539

* 0.13.1

* add url

* 0.13.2

* fix pack testing

* 0.13.3

* upgrade typescript 3

* 0.13.4

* vscode config clean

* 0.13.5
@huan
Copy link
Member Author

huan commented Aug 10, 2018

wechaty@0.19.142 & wechaty-puppet@0.13.7 had been published and included all the changes that you need.

Please try them and let me know if there are any problems.

@huan
Copy link
Member Author

huan commented Aug 12, 2018

@windmemory Please notice that I had just renamed Message.toUrl to Message.toUrlLink for better understanding and make it explicit different with the Url module from Node.js

And please close this issue after you have no more questions about the UrlLink support, thanks.

huan added a commit that referenced this issue Aug 12, 2018
@windmemory
Copy link
Member

wechaty-puppet-padchat v0.9.26 has been published, the link message's send, receive and forward operations are implemented. This issue could be closed.

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

No branches or pull requests

2 participants