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 toolkit14mo 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
Melio
Melio14mo 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
xmnlzOP14mo ago
lemme try
Melio
Melio14mo ago
kk!
xmnlz
xmnlzOP14mo ago
it's not working
Melio
Melio14mo ago
can u gave me the error ?
xmnlz
xmnlzOP14mo ago
No description
Melio
Melio14mo ago
send me the part of ur code plz! ts importation error
xmnlz
xmnlzOP14mo ago
await eventVoiceChannel.permissionOverwrites.edit({
permissionOverwrites: [
{
id: m,
deny: [PermissionFlagsBits.Connect],
},
],
});
await eventVoiceChannel.permissionOverwrites.edit({
permissionOverwrites: [
{
id: m,
deny: [PermissionFlagsBits.Connect],
},
],
});
Melio
Melio14mo ago
im on ts to
No description
Melio
Melio14mo ago
the eventVoiceChannel import 🙂 like const event... = [...]
xmnlz
xmnlzOP14mo ago
yes, tysm that works out
Melio
Melio14mo ago
ohh cool!
Want results from more Discord servers?
Add your server