Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

319
Vistas
Discord.js slash command permission system not working

This is the main code for the permission setting.

const run = (client) => __awaiter(void 0, void 0, void 0, function* () {
    const commandFiles = glob_1.default.sync(process.cwd() + "/src/commands/**/*{.ts,.js}");
    const guild = client.guilds.cache.get(config_json_1.default.guildId);
    commandFiles.map(value => {
        Promise.resolve().then(() => __importStar(require(value))).then((file) => __awaiter(void 0, void 0, void 0, function* () {
            exports.commands.set(file.info.name, file);
            const command = yield guild.commands.create(file.info);
            if (file.permission == undefined || file.permission == "@everyone")
                return;
            const json = (file.permission == "admin" ? {
                id: config_json_1.default.adminRole,
                permission: true,
                type: "ROLE"
            } : {
                id: config_json_1.default.freelancerRole,
                permission: true,
                type: "ROLE"
            });
            command.permissions.add({
                permissions: [json]
            });
        }));
    });

I have commissioned a dev for a discord bot and everything is working apart from the fact that anybody can use any command. He has a custom permission system that sets it with the above method. However, this does not work. I have debugged the config role ids, file.permission is set and he is positive it works. File.permission is set with exports.permission = "admin"; in a command file and defaultpermission is true.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Discord doesn't have permission called admin, you have to use ADMINISTRATOR permission instead!

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda