#slash command only visible to owner

1 messages ยท Page 1 of 1 (latest)

proven kindle
#

how do i make a slash command that is only visible and usable by bot owner

lone laurel
#

U cant

placid halo
frosty dew
open stirrup
#

Just as an alternative, if 'Admin' works for your use case, I think you can pass the default_member_permissions kwarg to the decorator with a Permissions object:

@commands.slash_command(name='asdf', default_member_permissions=discord.Permissions(administrator=True))
async def asdf(self, ctx):
  pass

This works for 'new' commands, so you'd have to deregister the command, and re-register to make it automatic.

While I've only used this for command groups, theoretically it should work for individual (parent) commands since it has the same handling. I'm sure someone will correct me if that's wrong. ๐Ÿ™‚

jagged temple
placid halo
#

hides

open stirrup
jagged temple
#

Interesting.

#

Thought it greyed out the command. Don't know if that's still a thing.

placid halo
#

it used to be greyed out, but discord changed it to hide

jagged temple
#

Ah, I see.

hidden plaza
#

If you have a bearer token then the bot can set a specific permission for that Slash Command that only permits certain members or roles to use that command
However, this is not built into Pycord so you'll have to do it manually

mossy belfry
#

Is there a way to do this but to instead be able to choose it based on roles?

open stirrup
#

Hopefully that'll come as an upgrade at some point

mossy belfry
#

What do you mean?

#

Under application command permission type, there's a value 1 which indicates role!

#

Does current pycord not allow you to do this when setting up application command permissions?

#

I'm struggling with updating my bot to using permissions_v2

open stirrup
#

Although there is an endpoint for updating.

mossy belfry
#

Is the endpoint valid?

open stirrup
mossy belfry
#

Are there plans for supporting it?

open stirrup
#

I'd imagine not, it's a completely separate authorization flow. But you may want to ask in other channels, as I can't speak to their intentions.

mossy belfry
#

Do you know if, by default, newly registered commands are set to admin only?