disnake
disnake copied to clipboard
Parameter injections don't support autocomplete when nested
Summary
See title
Reproduction Steps
Create a command, add an injection parameter (arg) which itself has another injection parameter (d).
Autocomplete for options of the nested injection parameter doesn't work.
Minimal Reproducible Code
@commands.injection()
def inj1(a: str, b: str):
return a + b
@inj1.autocomplete("a") # doesn't work
def autocomp_a(inter, value):
return [value]
@commands.injection()
def inj2(c: str, d = inj1):
return c + d
@inj2.autocomplete("c") # works
def autocomp_c(inter, value):
return [value]
@bot.slash_command()
async def cmd(inter, arg = inj2):
await inter.send(arg)
Expected Results
Both a and c have autocomplete enabled.
Actual Results
Only c autocompletes, the a option is registered with "autocomplete": false.
Intents
n/a
System Information
fe2690b5b16b0dcf0aa4676d0213b75250d275dd
Checklist
- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.
Additional Context
#670 https://github.com/DisnakeDev/disnake/blob/fe2690b5b16b0dcf0aa4676d0213b75250d275dd/disnake/ext/commands/params.py#L949-L958