Skip to content

Support message.toImage() method. #1913

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

Merged
merged 18 commits into from
Feb 18, 2020
Merged

Support message.toImage() method. #1913

merged 18 commits into from
Feb 18, 2020

Conversation

su-chang
Copy link
Member

I'm submitting a...

[ ] Bug Fix
[x] Feature
[ ] Other (Refactoring, Added tests, Documentation, ...)

Checklist

  • Commit Messages follow the Conventional Commits pattern
    • A feature commit message is prefixed "feat:"
    • A bugfix commit message is prefixed "fix:"
  • Tests for the changes have been added

Description

please describe the changes that you are making

for features, please describe how to use the new feature

please include a reference to an existing issue, if applicable

Does this PR introduce a breaking change?

[ ] Yes
[ ] No

@su-chang
Copy link
Member Author

Related issue: #1871

@@ -0,0 +1,64 @@
import { instanceToClass } from "clone-class"
Copy link
Member

Choose a reason for hiding this comment

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

Please run npm run lint:es before you send Pull Request, because we need to follow the original code styles.

@@ -966,6 +967,14 @@ export class Message extends Accessory implements Sayable {
return fileBox
}

public async toImage (): Promise<Image> {
Copy link
Member

Choose a reason for hiding this comment

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

When adding a new API, please also add the related JS Docs.

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.

I re-designed the Image class, please feel free to let me know if you have any questions.

@huan huan merged commit 297dc4f into wechaty:master Feb 18, 2020
@su-chang
Copy link
Member Author

Thanks for your re-design.

Only one question about it:
The method url("") has been removed from Image class, we do not need it any more?

@huan
Copy link
Member

huan commented Feb 18, 2020

Please see my reply from the issue.

We can archive that because we are now using FileBox to store the image information.

@su-chang
Copy link
Member Author

OK, everything well. I will make some changes for wechaty-puppet-padplus now.

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.

2 participants