#SOLVED Hide slash commands from everyone but certain users
14 messages · Page 1 of 1 (latest)
• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.
[email protected]
[email protected]
module.exports = {
data: {
name: "usage",
description: "Get usage statistics for the bot",
type: application.command.chat
},
I have looked through the docs but can only find stuff related to checking a users permissions (like if they can ban when executing a ban command) or checking for roles. I'd like to be able to by default hide the command from everyone else but certain users (and ideally not have to just update certain commands to a specific dev-only guild, as it would be nice to be able to run the commands elsewhere)
given the duration, duck is probably making a detailed response, but basically it's meant to be for the server's mods to handle now
commands will always be available to members with the admin perm, so to produce this effect, you should consider deploying only to guilds you manage (possibly with a default member permissions of 0)
then you can control who can use the command in the integrations tab of your server's settings
alternatively, just check for the user after receiving the interaction, instead of preventing the command from being seen (since admins will see it anyways)
That was what I was planning, unaware admins always saw it
admins can do everything except owner actions
they are above all permission checks (not hierarchy checks)
Thanks for the info, seems slash commands are limited in that regard (I could always resort to legacy commands)
you could just have legacy commands for those dev-only commands specifically
Thats what I mean
and you wouldn't need the MessageContent intent if you use a ping as well
ah ok, assumed you meant moving to all legacy commands, mb