Spur
Spur
DIAdiscord.js - Imagine an app
Created by Spur on 8/21/2023 in #djs-questions
Error 50013 thrown when giving and removing roles
Thank you!
26 replies
DIAdiscord.js - Imagine an app
Created by Spur on 8/21/2023 in #djs-questions
Error 50013 thrown when giving and removing roles
I had no idea that the order in which roles are stacked mattered lol
26 replies
DIAdiscord.js - Imagine an app
Created by Spur on 8/21/2023 in #djs-questions
Error 50013 thrown when giving and removing roles
You were right! Adjusting that order fixed it completely
26 replies
DIAdiscord.js - Imagine an app
Created by Spur on 8/21/2023 in #djs-questions
Error 50013 thrown when giving and removing roles
Ah ok
26 replies
DIAdiscord.js - Imagine an app
Created by Spur on 8/21/2023 in #djs-questions
Error 50013 thrown when giving and removing roles
The role it is trying to give is simply a color role with no perms attatched btw
26 replies
DIAdiscord.js - Imagine an app
Created by Spur on 8/21/2023 in #djs-questions
Error 50013 thrown when giving and removing roles
I see. Will enabling every permission allow it to give any role?
26 replies
DIAdiscord.js - Imagine an app
Created by Spur on 8/21/2023 in #djs-questions
Error 50013 thrown when giving and removing roles
Ah oof
26 replies
DIAdiscord.js - Imagine an app
Created by Spur on 8/21/2023 in #djs-questions
Error 50013 thrown when giving and removing roles
26 replies
DIAdiscord.js - Imagine an app
Created by Spur on 8/21/2023 in #djs-questions
Error 50013 thrown when giving and removing roles
When I added it to the test server, I set its permission code as 8 which I thought just made it an admin. I'll send its explicit perms rq
26 replies
DIAdiscord.js - Imagine an app
Created by Spur on 8/21/2023 in #djs-questions
Error 50013 thrown when giving and removing roles
Error is thrown right after line 12 (await interaction.member.roles.remove(roleID);) runs which leads me to think that it is a role-management permission problem
26 replies
DIAdiscord.js - Imagine an app
Created by Spur on 8/21/2023 in #djs-questions
Error 50013 thrown when giving and removing roles
Gateway intent bits:
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMessages,
],
});
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMessages,
],
});
26 replies
DIAdiscord.js - Imagine an app
Created by Spur on 8/21/2023 in #djs-questions
Error 50013 thrown when giving and removing roles
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('red')
.setDescription('Gives the red role'),
async execute(interaction) {
try {
const roleID = "1127757615112392704";
if (interaction.guild.roles.cache.get(roleID) != null) {
if (interaction.member.roles.cache.get(roleID) != null) {
await interaction.member.roles.remove(roleID);
await interaction.reply(`Role is already present and has been removed`);
} else {
await interaction.member.roles.add(roleID);
await interaction.reply('Role has been added!');
}
} else {
await interaction.reply({content: `hmm I couldn't find that role listed for this server`, ephemeral: true});
}
} catch(error) {
await interaction.reply({content: `Something went wrong: ${error.message}`, ephemeral: true});
}
},
};
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('red')
.setDescription('Gives the red role'),
async execute(interaction) {
try {
const roleID = "1127757615112392704";
if (interaction.guild.roles.cache.get(roleID) != null) {
if (interaction.member.roles.cache.get(roleID) != null) {
await interaction.member.roles.remove(roleID);
await interaction.reply(`Role is already present and has been removed`);
} else {
await interaction.member.roles.add(roleID);
await interaction.reply('Role has been added!');
}
} else {
await interaction.reply({content: `hmm I couldn't find that role listed for this server`, ephemeral: true});
}
} catch(error) {
await interaction.reply({content: `Something went wrong: ${error.message}`, ephemeral: true});
}
},
};
26 replies