aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar shtlrs <[email protected]>2024-02-18 21:31:51 +0100
committerGravatar shtlrs <[email protected]>2024-03-20 19:15:04 +0100
commit44920212acf0116399c14dfc11f083285ca9c28e (patch)
tree29494e8c205566a8ab37fd9e85e064f537b6db23
parentimplement the handler for the ApiError exception (diff)
fixup: correct UserNotPlayingError
-rw-r--r--bot/command_error_handlers/user_not_playing.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/bot/command_error_handlers/user_not_playing.py b/bot/command_error_handlers/user_not_playing.py
index b3238a79..87542478 100644
--- a/bot/command_error_handlers/user_not_playing.py
+++ b/bot/command_error_handlers/user_not_playing.py
@@ -1,16 +1,18 @@
from typing import NoReturn
from discord import Interaction
-from discord.ext.commands import CommandOnCooldown, Context
+from discord.ext.commands import Context
from pydis_core.utils.error_handling.commands import AbstractCommandErrorHandler
+from bot.utils.exceptions import UserNotPlayingError
+
class UserNotPlayingErrorHandler(AbstractCommandErrorHandler):
"""An handler for the UserNotPlayingError error."""
async def should_handle_error(self, error: Exception) -> bool:
"""A predicate that determines whether the error should be handled or not."""
- return isinstance(error, CommandOnCooldown)
+ return isinstance(error, UserNotPlayingError)
async def handle_text_command_error(self, context: Context, error: Exception) -> NoReturn:
"""Handle error raised in the context of text commands."""