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 });


Actually i try to fixed but i don't find alternative because ApplicationCommandPermissionData and GuildApplicationCommandPermissionData doesn't exist anymore. How fix this ?
Was this page helpful?