aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArjun Satarkar <me@arjunsatarkar.net>2023-12-25 13:25:09 +0000
committerArjun Satarkar <me@arjunsatarkar.net>2023-12-25 13:25:09 +0000
commit84f45dc19ae66555da6c378dc41b1182fb2fb2f6 (patch)
tree8dd25d2808e1644e04ece07b880bbdeb2473c1e0
parentf6716a5a46292e6adec4f31e2a8641f8cdbab8b5 (diff)
downloadaps-cogs-84f45dc19ae66555da6c378dc41b1182fb2fb2f6.tar
aps-cogs-84f45dc19ae66555da6c378dc41b1182fb2fb2f6.tar.gz
aps-cogs-84f45dc19ae66555da6c378dc41b1182fb2fb2f6.zip
question_of_the_day: fix unpin breaking if the message was deleted
-rw-r--r--question_of_the_day/question_of_the_day.py6
1 files 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