disnake
disnake copied to clipboard
checks doesn't work for autocompleters
Summary
checks doesn't work for autocompleters, they works only after I selected something from the list
Reproduction Steps
I run the command

Minimal Reproducible Code
import disnake
from disnake.ext import commands
LANGUAGES = ["python", "javascript", "typescript", "java", "rust", "lisp", "elixir"]
def test_check():
async def predicate(inter: disnake.ApplicationCommandInteraction):
if inter.user.id == 177494227918389249:
return True
return False
return commands.check(predicate) # type: ignore
class DisnakeIssue(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.slash_command()
@commands.has_permissions(manage_guild=True)
@test_check()
async def languages(
self, inter: disnake.ApplicationCommandInteraction, language: str
):
pass
@languages.autocomplete("language")
async def language_autocomp(
self, inter: disnake.ApplicationCommandInteraction, string: str
):
string = string.lower()
return [lang for lang in LANGUAGES if string in lang.lower()]
def setup(bot):
bot.add_cog(DisnakeIssue(bot))
print("DisnakeIssue is loaded.")
Expected Results
I should get error before I select something from this list, before I ran the command
Actual Results
I get an error only after I select something from the list
Intents
disnake.Intents.all()
System Information
- Python v3.8.10-final - disnake v2.5.1-final - disnake pkg_resources: v2.5.1 - aiohttp v3.7.4.post0 - system info: Windows 10 10.0.17763
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
https://discord.com/channels/808030843078836254/883342278280745030/984787279530848307
Confirmed this is a bug, thanks for reporting!
After 2 years? Really? Omg 😂😂😂😂😂