From 32c45231be89f4fd6833df25d682b4a8b6c7e437 Mon Sep 17 00:00:00 2001 From: Kyla Date: Sun, 17 Nov 2024 20:15:02 +0330 Subject: [PATCH] fix for KeyError when you Set your bot to use de-DE or es-ES. this will fix the https://github.com/Cog-Creators/Red-DiscordBot/issues/6471 issue and key errors. --- redbot/core/utils/chat_formatting.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/redbot/core/utils/chat_formatting.py b/redbot/core/utils/chat_formatting.py index 9a96ae380c6..20dc1a5b5bb 100644 --- a/redbot/core/utils/chat_formatting.py +++ b/redbot/core/utils/chat_formatting.py @@ -555,7 +555,10 @@ def humanize_list( """ - return babel_list(items, style=style, locale=get_babel_locale(locale)) + try: + return babel_list(items, style=style, locale=get_babel_locale(locale)) + except ValueError: + return ', '.join(items) def format_perms_list(perms: discord.Permissions) -> str: