#Sub_Command guild_ids

1 messages · Page 1 of 1 (latest)

open jolt
#

Is there a way to block out only specific sub_commands in a command group?

For example:

@my_data.client.slash_command()
async def dev(inter):
    pass

@dev.sub_command(description="DEVELOPER ONLY: Restarts the bot", guild_ids=[654646546546465464654654654])
async def restart(inter):
    k = developers_collection.find_one({'discord_id': int(inter.user.id)})
    if k != None:
        await inter.response.send_message(f'Restarting bot...')
        exit()
    else:
        await inter.response.send_message(content = 'This is a DEVELOPER ONLY command!')

Does not seem to work with the guild_ids=, but I don't want to block off all /dev commands just certain ones

wide flintBOT
#
Too Many Tags

Please use either the disnake or python tag, but not both. If your question pertains to disnake, please use the disnake tag. If your question is a general python question that does not depend on disnake, please use the python tag.
I've taken a guess based on the contents of your message which your question is actually about.

If you believe this to be in error, please let us know.

open jolt
#

Sub_Command guild_ids

solid pilot
#

nope, no can do. discord only allows you to set guild_ids on the parent command, and all children follow suit

open jolt
#

Ah darn 😦 Thanks!