-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
refactor(Emoji)!: make imageURL() changing extension dynamically #10613
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
Co-authored-by: Aura <[email protected]>
@@ -46,7 +46,7 @@ class Emoji extends Base { | |||
* @returns {?string} | |||
*/ | |||
imageURL(options) { | |||
return this.id && this.client.rest.cdn.emoji(this.id, options); | |||
return this.id && this.client.rest.cdn.emoji(this.id, this.animated ? { extension: 'gif', ...options } : options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, while this works, it might be worth adding support for the forceStatic
option like the other dynamic image URL methods
You'd have to change the parameter type to ImageURLOptions
and handle the forceStatic
option here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about adding an animated
option for the emoji
function in /rest?
Please describe the changes this PR makes and why it should be merged:
I think it'd be better if
Emoji#imageURL()
changes the extension dynamically as others...URL()
functions.Status and versioning classification: