Mephisto
Mephisto
DIdiscord.js - Imagine ❄
Created by Mephisto on 12/14/2024 in #djs-questions
Unknown Emoji Error when trying to react with unicode emojis
Hi, i am trying to react with a standard discord emoji, and based on the docs I am using the unicode emoji. I copied the exact emoji shown in the example (other unicode emojis don't work either) and tried to react, but I am getting the Unknown Emoji Error. My same code used to work earlier this year. This is the code I used to test it:
const { Client, GatewayIntentBits, Events, version } = require('discord.js');

void (async () => {
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent
]
});

await client.login(require('./env.json').dev.keys.token);
console.log(`Logged in with discord.js ${version}`);

client.on(Events.MessageCreate, async message => {
if (message.content.startsWith('react')) {
const response = await message.reply({ content: 'You can react with Unicode emojis!', fetchReply: true }); // this works
await response.react('😄'); // this does not
}
});
})();
const { Client, GatewayIntentBits, Events, version } = require('discord.js');

void (async () => {
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent
]
});

await client.login(require('./env.json').dev.keys.token);
console.log(`Logged in with discord.js ${version}`);

client.on(Events.MessageCreate, async message => {
if (message.content.startsWith('react')) {
const response = await message.reply({ content: 'You can react with Unicode emojis!', fetchReply: true }); // this works
await response.react('😄'); // this does not
}
});
})();
This is the output: https://pastebin.com/FiJnfqRn
16 replies