fix: catch ValueError

main
winston 2023-06-12 01:55:04 +02:00
parent edf6aa58ce
commit 6c304816e0
No known key found for this signature in database
GPG Key ID: 3786770EDBC2B481
1 changed files with 4 additions and 1 deletions

@ -135,4 +135,7 @@ class HornyTimer(commands.Cog):
async def _get_random_bonk_image(self, guild: Guild) -> BonkImage | None: async def _get_random_bonk_image(self, guild: Guild) -> BonkImage | None:
bonk_images = await self._get_bonk_images(guild) 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