React to message with emoji

I know it's probably something really simple but my bot sends a message not in response to an interaction. It should then react to that message with random emojis.
const channel = client.channels.cache.get("1239901826221080637");
const checkinOptions = {
"FoodEmojis": [
":canned_food:",
":pie:",
":rice:",
":spaghetti:",
":stew:",
":meat_on_bone:",
":cut_of_meat:",
":croissant:",
":pretzel:",
":french_bread:",
":bread:",
":salad:",
":sandwich:",
":poultry_leg:",
":hamburger:",
":pizza:",
":ramen:",
":curry:",
],
"DrinksEmojis": [
":tropical_drink:",
":beverage_box:",
":bubble_tea:",
":cup_with_straw:",
":milk:",
":tea:",
":coffee:",
],
"ToiletEmojis": [
":toilet:",
":poop:"
],
"PetsEmojis": [
":cat2:",
":dog2:",
":fish:",
":bird:",
":parrot:",
":snake:",
":hamster:",
":mouse2:",
]
};

const emojiFood = checkinOptions.FoodEmojis[Math.floor(Math.random() * checkinOptions.FoodEmojis.length)];
const emojiDrinks = checkinOptions.DrinksEmojis[Math.floor(Math.random() * checkinOptions.DrinksEmojis.length)];
const emojiPets = checkinOptions.PetsEmojis[Math.floor(Math.random() * checkinOptions.PetsEmojis.length)];

messageSend.content = "Complete this check in today";
messageSend.embeds = [
new EmbedBuilder()
.setTitle(`${checkinOptions.Title[Math.floor(Math.random() * checkinOptions.Title.length)]}`)
.setDescription(`Make sure you get these things done by the end of the day.\n\nFood: ${emojiFood}\nDrinks: ${emojiDrinks}\nPets: ${emojiPets}`)
.setColor('#00FBDC')
];
messageSend.fetchReply = true;

const message = await channel.send(messageSend);
await message.react(`${emojiFood}`);
await message.react(`${emojiDrinks}`);
await message.react(`${emojiPets}`);
const channel = client.channels.cache.get("1239901826221080637");
const checkinOptions = {
"FoodEmojis": [
":canned_food:",
":pie:",
":rice:",
":spaghetti:",
":stew:",
":meat_on_bone:",
":cut_of_meat:",
":croissant:",
":pretzel:",
":french_bread:",
":bread:",
":salad:",
":sandwich:",
":poultry_leg:",
":hamburger:",
":pizza:",
":ramen:",
":curry:",
],
"DrinksEmojis": [
":tropical_drink:",
":beverage_box:",
":bubble_tea:",
":cup_with_straw:",
":milk:",
":tea:",
":coffee:",
],
"ToiletEmojis": [
":toilet:",
":poop:"
],
"PetsEmojis": [
":cat2:",
":dog2:",
":fish:",
":bird:",
":parrot:",
":snake:",
":hamster:",
":mouse2:",
]
};

const emojiFood = checkinOptions.FoodEmojis[Math.floor(Math.random() * checkinOptions.FoodEmojis.length)];
const emojiDrinks = checkinOptions.DrinksEmojis[Math.floor(Math.random() * checkinOptions.DrinksEmojis.length)];
const emojiPets = checkinOptions.PetsEmojis[Math.floor(Math.random() * checkinOptions.PetsEmojis.length)];

messageSend.content = "Complete this check in today";
messageSend.embeds = [
new EmbedBuilder()
.setTitle(`${checkinOptions.Title[Math.floor(Math.random() * checkinOptions.Title.length)]}`)
.setDescription(`Make sure you get these things done by the end of the day.\n\nFood: ${emojiFood}\nDrinks: ${emojiDrinks}\nPets: ${emojiPets}`)
.setColor('#00FBDC')
];
messageSend.fetchReply = true;

const message = await channel.send(messageSend);
await message.react(`${emojiFood}`);
await message.react(`${emojiDrinks}`);
await message.react(`${emojiPets}`);
What am I missing?
5 Replies
d.js toolkit
d.js toolkit2mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
darp
darp2mo ago
error?
sproj003 ♿
sproj003 ♿2mo ago
Unhandled promise rejection: DiscordAPIError[10014]: Unknown Emoji
at handleErrors (C:\[...\Bot]\node_modules\.pnpm\@discordjs+rest@2.3.0\node_modules\@discordjs\rest\dist\index.js:730:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (C:\[...\Bot]\node_modules\.pnpm\@discordjs+rest@2.3.0\node_modules\@discordjs\rest\dist\index.js:1133:23)
at async SequentialHandler.queueRequest (C:\[...\Bot]\node_modules\.pnpm\@discordjs+rest@2.3.0\node_modules\@discordjs\rest\dist\index.js:963:14)
at async _REST.request (C:\[...\Bot]\node_modules\.pnpm\@discordjs+rest@2.3.0\node_modules\@discordjs\rest\dist\index.js:1278:22)
at async GuildMessageManager.react (C:\[...\Bot]\node_modules\.pnpm\discord.js@14.15.2_bufferutil@4.0.8\node_modules\discord.js\src\managers\MessageManager.js:255:5)
at async Message.react (C:\[...\Bot]\node_modules\.pnpm\discord.js@14.15.2_bufferutil@4.0.8\node_modules\discord.js\src\structures\Message.js:817:5)
at async sendCheckInsText (C:\[...\Bot]\functions\queuedMsgs.js:347:3)
Unhandled promise rejection: DiscordAPIError[10014]: Unknown Emoji
at handleErrors (C:\[...\Bot]\node_modules\.pnpm\@discordjs+rest@2.3.0\node_modules\@discordjs\rest\dist\index.js:730:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (C:\[...\Bot]\node_modules\.pnpm\@discordjs+rest@2.3.0\node_modules\@discordjs\rest\dist\index.js:1133:23)
at async SequentialHandler.queueRequest (C:\[...\Bot]\node_modules\.pnpm\@discordjs+rest@2.3.0\node_modules\@discordjs\rest\dist\index.js:963:14)
at async _REST.request (C:\[...\Bot]\node_modules\.pnpm\@discordjs+rest@2.3.0\node_modules\@discordjs\rest\dist\index.js:1278:22)
at async GuildMessageManager.react (C:\[...\Bot]\node_modules\.pnpm\discord.js@14.15.2_bufferutil@4.0.8\node_modules\discord.js\src\managers\MessageManager.js:255:5)
at async Message.react (C:\[...\Bot]\node_modules\.pnpm\discord.js@14.15.2_bufferutil@4.0.8\node_modules\discord.js\src\structures\Message.js:817:5)
at async sendCheckInsText (C:\[...\Bot]\functions\queuedMsgs.js:347:3)
darp
darp2mo ago
Emojis need to be unicode like so: '💀' Put \ before emoji to get unicode value
sproj003 ♿
sproj003 ♿2mo ago
Oh I thought you could do :skull: Ah, got it. Thanks.