Giter Site home page Giter Site logo

Comments (8)

didinele avatar didinele commented on June 27, 2024 1

Sorry, but myself or other team members are simply unable to reproduce. We do seem to indeed send jpg type in this specific case, but Discord doesn't even look at that - considering we're successfully able to create animated/gif emoji from our testing.

If you still believe this is an issue on our end, please open a new issue as a bug report, with a complete reproduction sample (e.g. a full script I can copy paste and just node).

from discord.js.

requizm avatar requizm commented on June 27, 2024

This is also a great example of good first issue, feel free to create a PR 👽

If nobody does it, I'll handle it in a couple of days.

from discord.js.

didinele avatar didinele commented on June 27, 2024

This is supported already. The function you're looking at is not used in the emoji creation process AFAIK. Can you provide a code sample that creates a JPG emote contrary to
your expectations?

from discord.js.

requizm avatar requizm commented on June 27, 2024

@didinele Oh, I couldn't find it. My code sample:

const buffer = getGifFromSomething();
await currentGuild.emojis.create({
  attachment: buffer, // How can I define image type as a GIF?
  name: emote.name,
});

I know I could use base64 encoded parameters just like data:image.... But is there any way to do without encoding base64 manually?

from discord.js.

didinele avatar didinele commented on June 27, 2024

And this ends up making it jpg? Are you sure your gif data is correct? Could you share what getGifFromSomething does/some sample return data I could use to test this?

from discord.js.

requizm avatar requizm commented on June 27, 2024

@didinele My problem is not related to getGifFromSomething() function. If I pass Buffer to currentGuild.emojis.create() function, That buffer is sent as a jpg to Discord API. But I also want to define buffer type like gif, jpeg or png.

I could also do this:

const buffer = getGifFromSomething();
await guild.emojis.create({
  attachment: `data:image/gif;base64,${buffer.toString('base64')}`,
  name: emote.name,
});

But I want to point out type parameter without base64 encoding.

from discord.js.

didinele avatar didinele commented on June 27, 2024

Okay, again, I'm not asking what is sent to Discord. Is it actually making it a static emote? If not, this doesn't matter.

from discord.js.

requizm avatar requizm commented on June 27, 2024

@didinele I'm sending an animated emote with image/jpg prefix, discord uploads as not animated emote. So it is a static emote.

from discord.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.