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

Function xxx.say() should return message id, make Wechaty message easy to extend. #1857

Closed
su-chang opened this issue Sep 24, 2019 · 1 comment

Comments

@su-chang
Copy link
Member

Is your feature request related to a problem? Please describe.

When I want to recalled the message which I have send just now, I don't know the message unique id of it in Wechaty.

Describe the solution you'd like

The return type of function xxx.say() should change from Promise<void> to Promise<string>, let's make it return the message id for extend options.

For example:

public async contact.say(text: string): Promise<string>

const msgId = await contact.say('hello')
const messagePayload = await bot.Message.load(msgId)
// do something with the `messagePayload`

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

[enhancement]

@huan
Copy link
Member

huan commented Sep 24, 2019

I liked this idea. Would love to see your PR and study how you could implemented it.

After that, we will be able to discuss it in details.

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