Closed martinbndr closed 2 years ago
It seems what you defined as "commands" is a list
Hmm strange it also does not work when I use the errors attribute of commands.errors, so commands.errors.CheckFailure
Ignoring exception in on_application_command_error
Traceback (most recent call last):
File "C:\Users\flore\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\client.py", line 352, in _run_event
await coro(*args, **kwargs)
File "c:\Users\flore\Documents\GitHub\Kaytem-Development\run.py", line 96, in on_application_command_error
if isinstance(error, commands.errors.CheckFailure):
AttributeError: 'list' object has no attribute 'errors'
I use these Imports for discord: from discord.ext import commands, tasks from discord.commands import permissions from discord.ext.commands import BucketType
I´m a bit confused why that happens because I saw the cooldown example that shows how to handle slash command errors. That works fine but with the same method But this check failure raises that error so maybe something related to the check failure in the pycord code or a issue with my code? Confuesd because I don't know there this error could be
cannot reproduce.
Try checking in your file if you have some sort of variable named commands
that may have overwritten the module.
Sry I solved it by using discord.commands.errors.errors.CheckFailure
directly.
Idk why I forgot to test that first xD
Summary
Custom Command Check raises unkown error that can not be ignored/should not be there (slash command)
Reproduction Steps
Create a custom command check like this:
Minimal Reproducible Code
Expected Results
If the command check fails there should not be a error because its handled in the error event.
Actual Results
This the check works but this error still gets raised:
AttributeError: 'list' object has no attribute 'CheckFailure'
Intents
intent = discord.Intents.default() intent.members = True intent.messages = True
System Information
Checklist
Additional Context
So to say finally: Having a custom check handled by the on_application_command_error works but there is a additional error that might be in the code of the pycord libary.