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

fix: guess correct file name when editing media #388

Merged
merged 2 commits into from
Mar 11, 2023

Conversation

KnorpelSenf
Copy link
Member

@KnorpelSenf KnorpelSenf commented Mar 10, 2023

When guessing a filename, no longer rely on the top-level property that contains the InputFile instance. Instead, directly look at the key behind which the InputFile instance is stored, however deep that may be. Also, if we are inside InputMedia*, use the media type instead. Also also, improve the list of known keys so that we get better at guess them.

Fixes #317.

Copy link
Contributor

@shevernitskiy shevernitskiy left a comment

Choose a reason for hiding this comment

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

LGTM!:)

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 36.36% and project coverage change: -0.04 ⚠️

Comparison is base (e95c1b2) 35.14% compared to head (d269a70) 35.10%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #388      +/-   ##
==========================================
- Coverage   35.14%   35.10%   -0.04%     
==========================================
  Files          16       16              
  Lines        4778     4785       +7     
  Branches      166      168       +2     
==========================================
+ Hits         1679     1680       +1     
- Misses       3097     3103       +6     
  Partials        2        2              
Impacted Files Coverage Δ
src/core/payload.ts 71.95% <36.36%> (-2.58%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@KnorpelSenf KnorpelSenf merged commit 321f5c4 into main Mar 11, 2023
@KnorpelSenf KnorpelSenf deleted the better-file-name-guessing branch March 11, 2023 11:52
@KnorpelSenf
Copy link
Member Author

@all-contributors add @shevernitskiy for this review

@allcontributors
Copy link
Contributor

@KnorpelSenf

I've put up a pull request to add @shevernitskiy! 🎉

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.

bug: editMessageMedia incorrect behaviour
4 participants