From 6d2ee2beda8408a51d2bdefa14ff58f95e977edd Mon Sep 17 00:00:00 2001 From: Xavier Mitault Date: Thu, 24 Oct 2024 21:44:13 +0100 Subject: [PATCH] Add try except --- worldtimezone/extensions/world_clock_tasks.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/worldtimezone/extensions/world_clock_tasks.py b/worldtimezone/extensions/world_clock_tasks.py index 550ec77..109c8a1 100644 --- a/worldtimezone/extensions/world_clock_tasks.py +++ b/worldtimezone/extensions/world_clock_tasks.py @@ -53,9 +53,12 @@ async def create_embed( ) embeds.append(embed) if len(embeds) != 0: - _ = await bot.rest.edit_message( - channel_world_clock, message_world_clock, None, embeds=embeds - ) + try: + _ = await bot.rest.edit_message( + channel_world_clock, message_world_clock, None, embeds=embeds + ) + except hikari.errors.ForbiddenError: + print(f"Failed update message: {guild.discord_id}") else: print(f"Failed update message: {guild.discord_id}")