GIFs (Klipy)

Send Klipy links as gifv content, or resolve a GIF URL for embeds.

Fluxer's unfurler turns a Klipy page URL in message content into a gifv embed. You do not build that embed yourself.

javascript
import { Client, Events } from '@fluxerjs/core';

const client = new Client();

client.on(Events.MessageCreate, async (message) => {
  if (message.content === '!gif') {
    await message.reply({
      content: 'https://klipy.com/gifs/stressed-gif-123',
    });
  }
});

That is the path for a full animated gifv preview.

Put a Klipy GIF inside a custom embed

setImage() needs a direct image URL. A klipy.com page URL will not work. Resolve it first:

javascript
import { EmbedBuilder, resolveKlipyToImageUrl } from '@fluxerjs/core';

const klipyUrl = 'https://klipy.com/gifs/stressed-gif-123';
const media = await resolveKlipyToImageUrl(klipyUrl);
if (!media) {
  await message.reply('Could not resolve that Klipy URL.');
  return;
}

const embed = new EmbedBuilder()
  .setTitle('Klipy in an embed')
  .setImage(media) // includes GIF url + IS_ANIMATED flags
  .setColor(0x5865f2);

await message.reply({ embeds: [embed] });

Rules of thumb

  • Want the native gifv unfurl? Send the Klipy URL as content.
  • Want your own title/fields around a GIF? Resolve to a GIF URL and use setImage.
  • Custom embeds cannot manufacture a gifv type. Only the unfurler path does that.