small question.
How can i make a slash command only visible to me?
photo:example
Literally searched the internet for 10 minutes and found NO answer. The only thing i found was how to make a slash command. Does anyone know how to do this? thanks.
>Solution :
@bot.tree.command(name="something")
async def something(interaction:discord.Interaction):
await interaction.response.send_message("NOTHING",ephemeral=True)
# optional (if you want to edit the response later,delete it, or send a followup)
await interaction.edit_original_response(content="Something")
await interaction.followup.send("This is a message too.",ephemeral=True)
await interaction.delete_original_response()
# if you have deleted the original response you can't edit it or send a followup after it
And these are the basics. If you don’t know how to load the commands:
@bot.event
async def on_ready():
print("Bot is online!")
try:
synced = await bot.tree.sync()
print(f"Synced {len(synced)} commands.")
except Exception as e:
print(e)
All set! Good luck with coding. If you need further help my discord is @rexy.py