Im trying to set permission for 10-12 users

Im struggling with the way discord.js <Channel>.edit() works, cuz i can't pass all users as array for example I trying to do so with <Channel>.permissionOverwrites.set, my idea is to clone old permissions and add new But i can't found a way to pass them right what i alredy tryed
await eventVoiceChannel.permissionOverwrites.set([
eventVoiceChannel.permissionOverwrites.cache,
{
id: m,
deny: [PermissionsBitField.Flags.Connect],
},
]);
await eventVoiceChannel.permissionOverwrites.set([
eventVoiceChannel.permissionOverwrites.cache,
{
id: m,
deny: [PermissionsBitField.Flags.Connect],
},
]);
and it didn't work, my question is how can i manage to make it work? :)
No description
13 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! - Marked as resolved by OP
M4LIO
M4LIO8mo ago
eventVoiceChannel?.edit({
permissionOverwrites: [
{
id: m,
deny: [PermissionFlagsBits.Connect],
}

]
})
eventVoiceChannel?.edit({
permissionOverwrites: [
{
id: m,
deny: [PermissionFlagsBits.Connect],
}

]
})
wait, i edit for match with ur code thats working ? @xmnlz
xmnlz
xmnlz8mo ago
lemme try
M4LIO
M4LIO8mo ago
kk!
xmnlz
xmnlz8mo ago
it's not working
M4LIO
M4LIO8mo ago
can u gave me the error ?
xmnlz
xmnlz8mo ago
No description
M4LIO
M4LIO8mo ago
send me the part of ur code plz! ts importation error
xmnlz
xmnlz8mo ago
await eventVoiceChannel.permissionOverwrites.edit({
permissionOverwrites: [
{
id: m,
deny: [PermissionFlagsBits.Connect],
},
],
});
await eventVoiceChannel.permissionOverwrites.edit({
permissionOverwrites: [
{
id: m,
deny: [PermissionFlagsBits.Connect],
},
],
});
M4LIO
M4LIO8mo ago
im on ts to
No description
M4LIO
M4LIO8mo ago
the eventVoiceChannel import 🙂 like const event... = [...]
xmnlz
xmnlz8mo ago
yes, tysm that works out
M4LIO
M4LIO8mo ago
ohh cool!