diff --git a/src/bot.py b/src/bot.py index 81ac552..e15bf1b 100644 --- a/src/bot.py +++ b/src/bot.py @@ -263,7 +263,7 @@ async def remove_subscribed_message(self, msg: SubscribedMessage) -> None: 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}') + self.logger.info(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 @@ -272,7 +272,7 @@ async def remove_subscribed_message(self, msg: SubscribedMessage) -> None: async def update_subscribed_messages(self) -> None: """Update all subscribed messages.""" - print('Updating subscribed messages') + self.logger.info('Updating subscribed messages') for sub_msg in self.subscribed_messages: # edit all subscribed messages message = self.stats_message( sub_msg.members, @@ -288,5 +288,5 @@ async def update_subscribed_messages(self) -> None: continue msg = await msg_channel.fetch_message(sub_msg.message_id) await msg.edit(content=message) - except AttributeError: # message is no longer available + except discord.errors.NotFound: # message is no longer available await self.remove_subscribed_message(sub_msg) diff --git a/src/constants.py b/src/constants.py index b619b1d..218d2a5 100644 --- a/src/constants.py +++ b/src/constants.py @@ -27,4 +27,4 @@ FEED_URL = "https://studentrobotics.org/feed.xml" FEED_CHANNEL_NAME = "blog" -FEED_CHECK_INTERVAL = 10 # seconds +FEED_CHECK_INTERVAL = 60 * 3 # in seconds