Hi! I have a problem with roleinfo command

Let me explain: roleinfo works with some roles, but not with others. As I understand it, this does not depend on: the language of the role, the number of characters/words in the role, whether this role is higher than the bot role roleinfo.js - https://mystb.in/RibbonTalkDistance Error:
Unhandled promise rejection: CombinedPropertyError (1)
Received one or more errors
input[3]
| CombinedPropertyError (1)
| Received one or more errors
|
| input.value
| | ExpectedConstraintError > s.string.lengthGreaterThanOrEqual
| | Invalid string length
| |
| | Expected: expected.length >= 1
| |
| | Received:
| | | ''
at ArrayValidator.handle (/home/container/node_modules/@sapphire/shapeshift/dist/index.js:473:70)
at ArrayValidator.parse (/home/container/node_modules/@sapphire/shapeshift/dist/index.js:212:88)
at EmbedBuilder.addFields (/home/container/node_modules/@discordjs/builders/dist/index.js:225:31)
at client.embed (/home/container/src/handlers/components/embed.js:203:27)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Unhandled promise rejection: CombinedPropertyError (1)
Received one or more errors
input[3]
| CombinedPropertyError (1)
| Received one or more errors
|
| input.value
| | ExpectedConstraintError > s.string.lengthGreaterThanOrEqual
| | Invalid string length
| |
| | Expected: expected.length >= 1
| |
| | Received:
| | | ''
at ArrayValidator.handle (/home/container/node_modules/@sapphire/shapeshift/dist/index.js:473:70)
at ArrayValidator.parse (/home/container/node_modules/@sapphire/shapeshift/dist/index.js:212:88)
at EmbedBuilder.addFields (/home/container/node_modules/@discordjs/builders/dist/index.js:225:31)
at client.embed (/home/container/src/handlers/components/embed.js:203:27)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
No description
No description
No description
No description
6 Replies
d.js toolkit
d.js toolkit13mo 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
Almaz
AlmazOP13mo ago
@Булочка | pasha_boez hi! if you can, can you help me? please
Булочка | pasha_boez
Hi. I think, some of your roles don't have permissions to show. You can check this with console.log(perms) before client.embed..., certainly, you get an empty array If it's true, you need to check array's length and enter something if length is 0
Almaz
AlmazOP13mo ago
can you show some example?
Булочка | pasha_boez
const Discord = require('discord.js');

module.exports = async (client, interaction, args) => {
const role = interaction.options.getRole('role');
const perms = role.permissions.toArray();

if (!role) {
return interaction.reply('Please provide a valid role.');
}

client.embed({
title: `ℹ️・Role information`,
thumbnail: interaction.guild.iconURL({ dynamic: true, size: 1024 }),
desc: `Information about the role ${role}`,
fields: [
{
name: 'Role ID:',
value: `${role.id}`,
inline: true
},
{
name: 'Role Name:',
value: `${role.name}`,
inline: true
},
{
name: 'Mentionable:',
value: `${role.mentionable ? 'Yes' : 'No'}`,
inline: true
},
{
name: 'Role Permissions:',
value: `${perms.length > 0 ? perms.join(', ') : "There are no permissions to display"}`
}
],
type: 'editreply'
}, interaction)
}


const Discord = require('discord.js');

module.exports = async (client, interaction, args) => {
const role = interaction.options.getRole('role');
const perms = role.permissions.toArray();

if (!role) {
return interaction.reply('Please provide a valid role.');
}

client.embed({
title: `ℹ️・Role information`,
thumbnail: interaction.guild.iconURL({ dynamic: true, size: 1024 }),
desc: `Information about the role ${role}`,
fields: [
{
name: 'Role ID:',
value: `${role.id}`,
inline: true
},
{
name: 'Role Name:',
value: `${role.name}`,
inline: true
},
{
name: 'Mentionable:',
value: `${role.mentionable ? 'Yes' : 'No'}`,
inline: true
},
{
name: 'Role Permissions:',
value: `${perms.length > 0 ? perms.join(', ') : "There are no permissions to display"}`
}
],
type: 'editreply'
}, interaction)
}


@! ! </Almaz> It's an example for this
Almaz
AlmazOP13mo ago
I see I'll check right now oh it worked Thank you
Want results from more Discord servers?
Add your server