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

Move stickers #167

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Move stickers #167

wants to merge 8 commits into from

Conversation

00-kat
Copy link
Contributor

@00-kat 00-kat commented Feb 24, 2025

Continuation of #158, thank you GitHub.

Closes the second part of #155, and based on #166 (merge that first).

Nothing much can be done about Lottie stickers (which some of the built-in ones are stored as) and animated stickers stored as APNGs (which show up as the first frame) however.

This is similar to the “fake-nitro” extension in some
things-that-shall-not-be-named.
This does not currently handle:
  - Stickers stored as GIFs, which seem to be on a different CDN despite
    what the API says.

This will never handle:
  - Stickers stored as Lottie images.
  - Proper display of animated PNGs, since Discord does not seem to
    like them.
For whatever reason, Discord stores stickers stored as GIFs on
a different CDN, but points to the one used for PNGs, APNGs and Lottie
images when querying the API for a sticker's URL.  This change attempts
to work around that by trying both CDNs and ensuring that any sticker
URL used is actually accessible.
These embeds could represent other moved stickers, or embeds created by
applications for other purposes.

Discord renders message containing both a sticker and an embed by
showing the sticker beneath the embed; our stickers are thus appended to
the end rather than the beginning.
I had previously missed the `format` attribute in stickers; using this
it is now possible to include an error message instead of silently
failing.
I had previously completely forgotten about the existence of HEAD, and
so went with streaming the contents but never reading it.
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.

1 participant