From e43bbf91c59694625b55a3e0b6a4fddc14dcb460 Mon Sep 17 00:00:00 2001 From: wlinator Date: Sun, 22 Sep 2024 17:37:41 +0200 Subject: [PATCH] Properly handle is_nsfw() errors --- handlers/error.py | 1 + locales/strings.en-US.json | 1 + 2 files changed, 2 insertions(+) diff --git a/handlers/error.py b/handlers/error.py index 704d25e..97bd33c 100644 --- a/handlers/error.py +++ b/handlers/error.py @@ -17,6 +17,7 @@ error_map: dict[type[Exception], str] = { commands.NoPrivateMessage: CONST.STRINGS["error_no_private_message_description"], commands.NotOwner: CONST.STRINGS["error_not_owner_unknown"], commands.PrivateMessageOnly: CONST.STRINGS["error_private_message_only_description"], + commands.NSFWChannelRequired: CONST.STRINGS["error_nsfw_channel_required_description"], exceptions.BirthdaysDisabled: CONST.STRINGS["error_birthdays_disabled_description"], } diff --git a/locales/strings.en-US.json b/locales/strings.en-US.json index fdc0132..967233d 100644 --- a/locales/strings.en-US.json +++ b/locales/strings.en-US.json @@ -178,6 +178,7 @@ "error_not_enough_cash": "you don't have enough cash.", "error_not_owner": "{0} tried to use a bot admin command ({1})", "error_not_owner_unknown": "Unknown", + "error_nsfw_channel_required_description": "this command can only be used in Age-Restricted (NSFW) channels.", "error_out_of_time": "you ran out of time.", "error_out_of_time_economy": "you ran out of time. Your bet was forfeited.", "error_private_message_only_author": "Private Message Only",