I created an emoji list command here is my code of the command:
const { MessageEmbed } = require('discord.js');
module.exports = {
name: "emojis",
description: "Gets a guild\'s emojis",
async run (client, message, args) {
const emojis = [];
message.guild.emojis.cache.forEach(e => emojis.push(`${e} **-** \`:${e.name}:\``));
const embed = new MessageEmbed()
.setTitle(`Emoji List`)
.setDescription(emojis.join('\n'))
message.channel.send(embed)
}
};
However I get this error in case the characters in the embed exceeds 2048 letters:
(node:211) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body
embed.description: Must be 2048 or fewer in length.
at RequestHandler.execute (/home/runner/Utki-the-bot/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:211) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:211) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Is there any way the bot can still show the emojis and there names. By using discord-menu or like that. I was unable to understand how to do that. Can you help me out? Thanks in Advance