'How can I fix the issue of the bot having the perms but saying it doesnt?

A few Months ago, I updated my discord bot to discord.js v13, as a package I wanted to use required v13 and up, with the change it made my inventory break. I was using discord.js-menu to create my inventory pages and it would update every time someone would run pr!summon with adding the card to their inventory, this of course would give each card an embed on their own (which I'd like to avoid if possible). I would also like to mention I used MongoDB for my database currently.

This is the error I've been getting with the code that've included below: [96m[discord.js-menu][0m DiscordAPIError: Cannot send an empty message (whilst trying to send menu message) | You're probably missing 'SEND_MESSAGES' or 'EMBED_LINKS' in <#channel> (server), needed for sending the menu message. I've looked up already that giving the bot's the permissions that it says its missing will fix the issue but my bot has always had these permissions, I then kicked it and re-added it making sure these perms were included (still same issue), even tried giving it admin didn't do anything. I came to a conclusion that it must be that since the package isn't up to date with v13 that its not working correctly. If there are any other packages that could either give the same effect or give me the ability to make this example I've provided possible, it would be greatly appreciated: https://i.stack.imgur.com/LjYl6.png.

The code below just shows what the bot would reply with if you had no cards in the database and gives you help on how to obtain some, then if you have someone it would reply with the inventory embed: https://i.stack.imgur.com/CNVJc.png. I was also able to sort by the rarities of the cards, but I'm probably gonna be removing it and switching to group name, idol name or group id's.

let args = message.content.split(' ');

            const command = args[2]
            if (!command) {
                if(data.characters.length === 0) {
                    let WarningEmbed = new Discord.MessageEmbed()
                        .setColor(process.env.WARNING)
                        .setAuthor({
                            name: `Inventory - ${message.author.tag}`, 
                            iconURL: message.author.displayAvatarURL({ dynamic: true })
                        })
                        .setDescription('You haven\'t claimed anything yet, try running `pr!summon`.')
                    message.channel.send({embeds: [WarningEmbed]})
                    return;
                }
                const pages = [];
                data.characters.sort((a,b) => (a.rarity < b.rarity) ? 1: -1);

                for(let i = 0; i < data.characters.length; i++) {
                    pages[i] = { name: 'page' + i,
                                content: new Discord.MessageEmbed({
                                    color: `${process.env.ECOLOR}`,
                                    author: `Viewing your inventory`,
                                    title: `${data.characters[i].group} ${data.characters[i].name}`,
                                    description: `Positions: **${data.characters[i].positions}**\nEra: **${data.characters[i].era}**\nCode: **${data.characters[i].code}**`,
                                    fields: [
                                        { name: `Level ${data.characters[i].level}`, value: `${data.characters[i].exp} / ${data.characters[i].level * 100} XP`, inline: true},
                                        { name: '⚔️ Attack', value: `${data.characters[i].attack}`, inline: true},
                                        { name: '❤️ Health', value: `${data.characters[i].hp}`, inline: true}
                                    ],
                                    thumbnail: { url: data.characters[i].image }
                                }),
                                reactions: {
                                    '⏪': 'first',
                                    '◀️': 'previous',
                                    '▶️': 'next',
                                    '⏩': 'last'
                                    }
                                }
                        }
                    let teamMenu = new Menu(message.channel, message.author.id, pages, 300000);
                    teamMenu.start();
                return;
            }
            command.toLowerCase();```


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source