From 84f45dc19ae66555da6c378dc41b1182fb2fb2f6 Mon Sep 17 00:00:00 2001 From: Arjun Satarkar Date: Mon, 25 Dec 2023 18:55:09 +0530 Subject: question_of_the_day: fix unpin breaking if the message was deleted --- question_of_the_day/question_of_the_day.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/question_of_the_day/question_of_the_day.py b/question_of_the_day/question_of_the_day.py index 3f7971e..391352b 100644 --- a/question_of_the_day/question_of_the_day.py +++ b/question_of_the_day/question_of_the_day.py @@ -399,10 +399,10 @@ class QuestionOfTheDay(commands.Cog): channel = await guild.fetch_channel( latest_qotd_message_info["channel_id"] ) - old_message = await channel.fetch_message( - latest_qotd_message_info["message_id"] - ) try: + old_message = await channel.fetch_message( + latest_qotd_message_info["message_id"] + ) await old_message.unpin(reason="Unpinning old question of the day.") except (discord.Forbidden, discord.NotFound): pass -- cgit v1.2.3-57-g22cb