Hi,
I'm trying to create a discord bot slash command.
I know how to create the commands themselves, and add parameters to them, but I'm trying to make optional parameters, and if the option isn't selected, for it to spit out a default response.
Ex:
@bot.tree.command(name='CommandName', description='Command Description.')
@app_commands.describe(Option = 'This is an option for the command.')
async def CommandName(interaction: discord.Interaction, Option: str):
await interaction.response.send_message(f'{interaction.user.mention} chose {Option}.')
I have the associated libraries installed for a discord bot, I just posted an example for the command involved.
In the "Option" parameter I've created, I tried adding py required = False but I've gotten an error saying I've added an unknown parameter.
but also are you using a cog?