Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

209
Views
Manejo de comandos = Permisos de comandos de barra oblicua

Tienes el manejo de comandos, por ejemplo:

 const { SlashCommandBuilder } = require('@discordjs/builders'); module.exports = { data: new SlashCommandBuilder() .setName('avatar') .setDescription('Get the avatar URL of the selected user, or your own avatar.') .addUserOption(option => option.setName('target').setDescription('The user\'s avatar to show')), async execute(interaction) { const user = interaction.options.getUser('target'); if (user) return interaction.reply(`${user.username}'s avatar: ${user.displayAvatarURL({ dynamic: true })}`); return interaction.reply(`Your avatar: ${interaction.user.displayAvatarURL({ dynamic: true })}`); }, };

Ahora la pregunta, ¿cómo puedo integrar los permisos del comando de barra?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Simplemente puede usar el GuildMember#Permission#has() mientras obtiene el objeto GuildMember de Interaction#member así:

 let flag = `ADMINISTRATOR`; // permission flag needed if (!interaction.member.permissions.has(flag)) { return await interaction.reply({ content: `You Don't Have The Permisssion To Execute this command, must have the following permission: **${flag}**`, ephemeral: true }); }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!