Missing Access when deleting a VC but it does have the Manage Channel permissions?

const Party = require("../models/Party");
const UserProfile = require("../models/UserProfile");

async function deleteParty(partyID){
let party = await Party.findOne({ userID: partyID });

if(!party){ return; };

const guild = await client.guilds.fetch(party.serverID);
if(!guild){ return; };

const role = await guild.roles.fetch(party.roleID);
if(role){ await role.delete(); };

const vc = await guild.channels.fetch(party.vcID);
if(vc){ await vc.delete(); }; //Error is here

for(let i = 0; i < party.members.length; i++){
let member = await UserProfile.findOne({ userID: party.members[i] });
if(member){
member.partyInfo.partyID = undefined;

member.markModified("partyInfo");
await member.save();
}
}

await party.delete();
}

module.exports = deleteParty;
const Party = require("../models/Party");
const UserProfile = require("../models/UserProfile");

async function deleteParty(partyID){
let party = await Party.findOne({ userID: partyID });

if(!party){ return; };

const guild = await client.guilds.fetch(party.serverID);
if(!guild){ return; };

const role = await guild.roles.fetch(party.roleID);
if(role){ await role.delete(); };

const vc = await guild.channels.fetch(party.vcID);
if(vc){ await vc.delete(); }; //Error is here

for(let i = 0; i < party.members.length; i++){
let member = await UserProfile.findOne({ userID: party.members[i] });
if(member){
member.partyInfo.partyID = undefined;

member.markModified("partyInfo");
await member.save();
}
}

await party.delete();
}

module.exports = deleteParty;
When creating the VC:
{
id: interaction.client.user.id,
allow: ["ManageChannels"],
}
{
id: interaction.client.user.id,
allow: ["ManageChannels"],
}
(image attached to show that this permission overwrite works) does it need another permission? nobody is connected to the VC and the category doesn't have any permission changes. And the bot itself has the manage channels permission
No description
2 Replies
d.js toolkit
d.js toolkit8mo 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!
BradyDaLlama .*˖
oh and here's the error:
{
error: DiscordAPIError[50001]: Missing Access
at SequentialHandler.runRequest (...\bot\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:933:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.queueRequest (...\bot\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:712:14)
at async REST.request (...\Desktop\bot\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:1321:22)
at async GuildChannelManager.delete (...\bot\node_modules\discord.js\src\managers\GuildChannelManager.js:482:5)
at async VoiceChannel.delete (...\bot\node_modules\discord.js\src\structures\GuildChannel.js:452:5)
at async deleteParty (...\bot\Party functions\deleteParty.js:16:13)
at async leaveParty (...\bot\Party functions\leaveParty.js:51:9)
at async Object.execute (...\bot\events\interactionCreate.js:289:7) {
rawError: { message: 'Missing Access', code: 50001 },
code: 50001,
status: 403,
method: 'DELETE',
url: 'https://discord.com/api/v10/channels/1165414994251358300',
requestBody: { files: undefined, json: undefined }
}
}
{
error: DiscordAPIError[50001]: Missing Access
at SequentialHandler.runRequest (...\bot\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:933:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.queueRequest (...\bot\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:712:14)
at async REST.request (...\Desktop\bot\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:1321:22)
at async GuildChannelManager.delete (...\bot\node_modules\discord.js\src\managers\GuildChannelManager.js:482:5)
at async VoiceChannel.delete (...\bot\node_modules\discord.js\src\structures\GuildChannel.js:452:5)
at async deleteParty (...\bot\Party functions\deleteParty.js:16:13)
at async leaveParty (...\bot\Party functions\leaveParty.js:51:9)
at async Object.execute (...\bot\events\interactionCreate.js:289:7) {
rawError: { message: 'Missing Access', code: 50001 },
code: 50001,
status: 403,
method: 'DELETE',
url: 'https://discord.com/api/v10/channels/1165414994251358300',
requestBody: { files: undefined, json: undefined }
}
}
ahhh ok it doesn't have connect permissions yup that does it! I think they should update the manage channel description, it doesn't mention needing the connect permission ^^'
Want results from more Discord servers?
Add your server
More Posts