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

Want to create UrlLink with control on all properties #1541

Closed
windmemory opened this issue Aug 12, 2018 · 3 comments
Closed

Want to create UrlLink with control on all properties #1541

windmemory opened this issue Aug 12, 2018 · 3 comments

Comments

@windmemory
Copy link
Member

When create a new UrlLink, the title, thumbnailurl and description are immutable, and I can not assign customize properties to it. I think these properties should be assignable.

Use case

I would like to generate some url link message myself, and save it to db. Every time I start the bot, I want the bot to load the url message and distribute to my users.

What do you think?

@huan
Copy link
Member

huan commented Aug 12, 2018

I think it can be easily done by the current immutable UrlLink.

I believe you can create as many UrlLink instances as you like, for example:

for (const payload of getFromDb()) {
  wechaty.say(new UrlLink(payload))
}

@windmemory
Copy link
Member Author

Well, that works, thanks for the clarification! You are the best :)

@huan
Copy link
Member

huan commented Aug 13, 2018

Great, you are welcome

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

No branches or pull requests

2 participants