Anyone can help me to fix old code ?

Hi there! Actually i'm stuck on an old code.
const fullPermissions = commandsCol.reduce<
GuildApplicationCommandPermissionData[]
>((a, b) => {
const roles = getRoles(b.name);
if (!roles) return a;

const command = this.commands.get(b.name)!;

if (command.onlyDev)
return [
...a,
{
id: b.id,
permissions: devArr
}
];

const permissions = roles.reduce<
ApplicationCommandPermissionData[]
>((x, y) => {
return [
...x,
{
id: y.id,
type: 'ROLE',
permission: true
}
];
}, devArr);

return [
...a,
{
id: b.id,
permissions
}
];
}, []);

await guild.commands.permissions.set({ fullPermissions });
const fullPermissions = commandsCol.reduce<
GuildApplicationCommandPermissionData[]
>((a, b) => {
const roles = getRoles(b.name);
if (!roles) return a;

const command = this.commands.get(b.name)!;

if (command.onlyDev)
return [
...a,
{
id: b.id,
permissions: devArr
}
];

const permissions = roles.reduce<
ApplicationCommandPermissionData[]
>((x, y) => {
return [
...x,
{
id: y.id,
type: 'ROLE',
permission: true
}
];
}, devArr);

return [
...a,
{
id: b.id,
permissions
}
];
}, []);

await guild.commands.permissions.set({ fullPermissions });
Actually i try to fixed but i don't find alternative because ApplicationCommandPermissionData and GuildApplicationCommandPermissionData doesn't exist anymore. How fix this ?
3 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!
Ugolin Ollé
Ugolin OlléOP13mo ago
How set permissions so? Mmmmh okay i gonna check haha Thx
d.js docs
d.js docs13mo ago
method SlashCommandBuilder#setDefaultMemberPermissions() Sets the default permissions a member should have in order to run the command.
Want results from more Discord servers?
Add your server