aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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."""