Slash per-subcommand permissions

Kommentare

6 Kommentare

  • Pukima

    Would like to see that feature as well!

    1
  • Paul

    Would love to see this as well - ran into the same problem just now!

     

    1
  • Sage

    I would love to see this as well.. I wanted a delete and report subcommand added to a command, but now I have to do some sketchy stuff bypassing this, by requiring the server admins to add a role that is required to use the delete command.

    0
  • Sage

    until they roll out a feature, you can use something like this though:

    const { PermissionFlagsBits } = require("discord.js");
    
    async execute(interaction) {
    	if (!interaction.member.permissions.has(PermissionFlagsBits.ManageMessages)) {
    		await interaction.reply("Insufficient permissions!");
    		return;
    	}
    };

    This will quickly return “Insufficient permissions!” as a reply to the user sending the slash command. This will still show the command to said user, but as long as they do not have the set permissions (in this case to Manage Messages) they will not be able to execute the command

    Hope this helped!

    0
  • Paul

    Sage- that works as a hard coded implementation, but I think the point of this suggestion is for server owners to be able to customise these permissions for each subcommand through the UI.

    1
  • Sage

    Paul- of course! It would be great to see a proper implementation, I only suggested this as an option in the meantime, as this allows some limitation. Additionally, you could set up a choice based command, that can edit hard-coded permissions for different subcommands, though on the backend you would have to save these choices in a separate database. All kind of wonky, but this may be good to implement for the time being, as Discord has not changed this yet sadly

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.