Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes #33

Merged
merged 3 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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)
2 changes: 1 addition & 1 deletion src/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading