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 default avatar URL not working #691

Merged
merged 7 commits into from
Sep 15, 2022

Conversation

MrPowerGamerBR
Copy link
Contributor

This PR changes that now the format must be provided when initializing the Icon class, instead of relying on the animated property.

Fixes #689

@@ -6401,8 +6401,7 @@ public final class dev/kord/core/entity/GuildWidget : dev/kord/core/KordObject,
}

public abstract class dev/kord/core/entity/Icon : dev/kord/core/KordObject {
public synthetic fun <init> (ZLdev/kord/rest/route/CdnUrl;Ldev/kord/core/Kord;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun getAnimated ()Z
Copy link
Member

@lukellmann lukellmann Sep 15, 2022

Choose a reason for hiding this comment

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

Could you bring animated back for binary compatibility? Not sure if it should be deprecated though.

Copy link
Member

@lukellmann lukellmann left a comment

Choose a reason for hiding this comment

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

thanks

@MrPowerGamerBR
Copy link
Contributor Author

I readded the animated property @lukellmann. :3

Originally I added it by just checking if the Image.Format is GIF, however, to future proof the code, I've decided to keep it in the constructor itself.

The reason why I made it that way: Stickers aren't supported as a Icon yet, but when they are supported, the code would need to be changed because animated stickers can be LOTTIE or APNG files, so both aren't GIFs.

And static stickers are also PNG! So a simple format check wouldn't have worked. (Discord Docs doesn't have a distinction between PNG and APNG in their CDN docs)

@lukellmann lukellmann merged commit 369e46d into kordlib:0.8.x Sep 15, 2022
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.

Default avatar not working
2 participants