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

Add Twitch preview link for largeImageURL #3655

Merged
merged 1 commit into from Jan 4, 2020

Conversation

@tipakA
Copy link
Contributor

tipakA commented Jan 1, 2020

Please describe the changes this PR makes and why it should be merged:
Twitch presence large image asset has link leading to different place than discord endpoints, so using largeImageURL() returns https://cdn.discordapp.com/app-assets/null/twitch:tipaka_.webp instead of actual link.

The url link i added to code gives image in highest possible resolution, which is capped by the stream itself, leaving room for inconsistent picture resolution. However, the cdn is able to dynamically change resolution for the picture, by adding for example -1920x1080 just before .png, or virtually any other resolution, even larger than stream is in or in different ratio (For example resolution in discord client is 108x60).
On the other side, most methods in library assume that pictures are square, so size: 2048 means 2048x2048. That's not exactly a good idea to apply such resolution on a Full HD preview.

Status

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

Semantic versioning classification:

  • This PR changes the library's interface (methods or parameters added)
    • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
  • This PR only includes non-code changes, like changes to documentation, README, etc.
@SpaceEEC SpaceEEC merged commit bf31b28 into discordjs:master Jan 4, 2020
3 checks passed
3 checks passed
ESLint ESLint
Details
TSLint
Details
Documentation
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.