#Slash command help

1 messages · Page 1 of 1 (latest)

twilit oar
#

How do I add an optional argument to a slash command, that when no value is given, it sets it to a default?

zenith niche
#

Give the parameter a default value

bronze viper
#

assign a default value to the parameter

@commands.slash_command()
async def my_command(self, inter, my_parameter: Optional[str] = None):
    ...

don't copypaste the example

zenith niche
#

(It doesn't have to be None)

twilit oar
#

tysm!

twilit oar
#

wait its working

#

yoy