Sending stickers in Discord.js V13

Viewed 2089

I am trying to forward messages sent to my bot via DM. Everything works, except sending the stickers.

Every time I try to send the a message with a sticker, I just get an Error DiscordAPIError: Cannot use this sticker.

This is part my code:

let userMessage = new discord.MessageEmbed().setDescription(message.content || "᲼")
let messageAttachment =
    message.attachments.size > 0 ? message.attachments.first().url : null
userMessage.setImage(messageAttachment)

let messagePayload = {
    content: null,
    embeds: [],
    stickers: null
}

messagePayload.content = `User <@${message.author.id}> said:`
messagePayload.embeds.push(userMessage)
messagePayload.stickers = message.stickers?.size > 0 ? [message.stickers.first()] : null
client.users.fetch(config.ids.me, false).then((user) => {
    user.send(messagePayload)
})

and the messagePayload looks like this:

{
  content: 'User <@USERID> said:',
  embeds: [
    MessageEmbed {
      type: 'rich',
      title: null,
      description: '᲼',
      url: null,
      color: null,
      timestamp: null,
      fields: [],
      thumbnail: null,
      image: [Object],
      video: null,
      author: null,
      provider: null,
      footer: null
    }
  ],
  stickers: [
    Sticker {
      id: '749054660769218631',
      description: null,
      type: null,
      format: 'LOTTIE',
      name: 'Wave',
      packId: null,
      tags: null,
      available: null,
      guildId: null,
      user: null,
      sortValue: null
    }
  ]
}

In the Docs about sending stickers, it just says it has to be an Array either a Sticker-Object or a Snowflake. Since I am fetching the sticker Object, I assumed that just grabbing it and passing it into my messagePayload would do the job, but somehow the API does not accept it.

discord.Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS, is set, but it does not work with standard stickers aswell (e.g. messagePayload above)

1 Answers

As it turns out, you can only send stickers from a guild, inside that same guild.

See Github Issue.

Related