From 6c304816e0920fcf3b4aa60339ba8fa11dc1f76d Mon Sep 17 00:00:00 2001 From: winston Date: Mon, 12 Jun 2023 01:55:04 +0200 Subject: [PATCH] fix: catch ValueError --- hornytimer/hornytimer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hornytimer/hornytimer.py b/hornytimer/hornytimer.py index 74c07c8..73f98f5 100644 --- a/hornytimer/hornytimer.py +++ b/hornytimer/hornytimer.py @@ -135,4 +135,7 @@ class HornyTimer(commands.Cog): async def _get_random_bonk_image(self, guild: Guild) -> BonkImage | None: bonk_images = await self._get_bonk_images(guild) - return bonk_images[random.randint(0, len(bonk_images) - 1)] + try: + return bonk_images[random.randint(0, len(bonk_images) - 1)] + except: + return None