diff --git a/src/bot.py b/src/bot.py index bc8c29b..5738d98 100644 --- a/src/bot.py +++ b/src/bot.py @@ -232,9 +232,10 @@ async def remove_subscribed_message(self, msg: SubscribedMessage) -> None: return message = await msg_channel.fetch_message(msg.message_id) - chan_name = message.channel.name if hasattr(message.channel, 'name') else 'unknown channel' - print(f'Removing message in {chan_name} from {message.author.name}') - await message.delete() # remove message from discord + if message: # message may have already been deleted manually + chan_name = message.channel.name if hasattr(message.channel, 'name') else 'unknown channel' + print(f'Removing message in {chan_name} from {message.author.name}') + await message.delete() # remove message from discord # remove message from subscription list and save to file self.subscribed_messages.remove(msg)