#๐Ÿ”’ Hide slash commands from user

7 messages ยท Page 1 of 1 (latest)

glad garden
#

Is there a way to hide some slash commands from users, i want only admins to have access to the command. So i have verification if is administrator but the users can see the command and when they use the command they get "The application did not respond", i want to hide it from them.

    @app_commands.command(name="addmoney", description="Command to add money") @app_commands.checks.has_permissions(administrator=True)
    async def add_money(self, interaction: discord.Interaction, member: discord.Member, amount: app_commands.Range[int, MONEY_MIN, MONEY_MAX]):
        user_id = member.id
        self.collection.update_one({"discord_id": user_id}, {"$inc": {"balance": amount}})
        await interaction.response.send_message(f"Succesfully added ${amount} to {member.mention}", ephemeral=True)
        await member.send(f"{member.mention}, you have received ${amount} from {interaction.user.mention}")
        return
royal spokeBOT
#

@glad garden

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

raven garnet
#

You can change that under the server settings
bots should not restrict that themselves - slash commands are properly integrated with discord unlike text commands, and that is one of the advantages that come with it

glad garden
royal spokeBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.

#

๐Ÿ”’ Hide slash commands from user