Let's assume there's a slash command /selectappointment you can use to make an appointment somewhere. As inputs we need: Year of appointment, Month of appointment (other parameters skipped for simplicity sake)
@client.slash_command()
async def selectappointment(interaction: nextcord.Interaction):
Now, we add a SlashOption + choices to only accept the current or next year as an input:
@client.slash_command()
async def selectappointment(interaction: nextcord.Interaction,
year: int = nextcord.SlashOption(name='year',
choices={'2022':2022, '2023':2023})):
Next, we want to add a 'month' SlashOption + choices. (Assume MONTHS = {'January':1, 'February':2} etc.)
@client.slash_command()
async def selectappointment(interaction: nextcord.Interaction,
year: int = nextcord.SlashOption(name='year',
choices={'2022':2022, '2023':2023}),
month: int = nextcord.SlashOption(name='month',
choices={MONTHS})):
This is where the problem occurs. There are twelve months/year. Say the person using the command selected '2022' as the year of the appoinment, but they still can select, let's say, February, although it is August already. It makes no sense to allow inputs to book appointments in the past.
That's where my question comes in: Is it possible that, in case the user selected 2022, the month parameter only displays the choices August-December? Is there something like 'dynamic slashOptions', based on the user's prior selection from the list of choices?