Skip to content

Commit 242c932

Browse files
committed
Add scheduled event earlier
1 parent e6f5268 commit 242c932

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ async def on_add_checkmark_reaction(self, reaction: RawReactionActionEvent) -> N
8181
add_localized_times_to_embed(embed, meeting_notification.date)
8282

8383
message = await channel.send(
84-
"Hey @everyone 👋 the next monthly meeting will happen "
84+
"Hey @meeting-watchers 👋 the next monthly meeting will happen "
8585
f"{meeting_notification.date.humanize()} 📅\n"
8686
f"Realtime notes will be posted here: {NOTES_LINK}.\n\n"
8787
"Feel free to add any topics you'd like to discuss in the meeting! 🍓",

src/meeting.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from .date_utils import add_localized_times_to_embed
1515

1616

17-
async def add_schedule_event(next_meeting: ics.Event, guild: nextcord.Guild):
17+
async def add_scheduled_event(next_meeting: ics.Event, guild: nextcord.Guild):
1818
scheduled_event = get_scheduled_event_for_date(next_meeting.begin.isoformat())
1919

2020
if not scheduled_event:
@@ -38,16 +38,23 @@ async def find_next_event_and_notify_core_team(client: nextcord.Client):
3838
print("No next meeting found")
3939
return
4040

41-
if (next_meeting.begin - arrow.now()).days > 3:
41+
next_meeting_in_days = (next_meeting.begin - arrow.now()).days
42+
43+
channel = client.get_channel(CORE_DEVS_CHANNEL_ID)
44+
assert isinstance(channel, nextcord.channel.TextChannel)
45+
46+
if next_meeting_in_days > 25:
47+
print("Next meeting is more than 25 days away, not adding the scheduled event")
48+
49+
await add_scheduled_event(next_meeting, channel.guild)
50+
51+
if next_meeting_in_days > 3:
4252
print("Next meeting is more than 3 days away")
4353
return
4454

4555
event_date = next_meeting.begin.isoformat()
4656
notification = get_notification_for_date(event_date, "core_devs")
4757

48-
channel = client.get_channel(CORE_DEVS_CHANNEL_ID)
49-
assert isinstance(channel, nextcord.channel.TextChannel)
50-
5158
if not notification:
5259
embed = nextcord.Embed(color=5814783)
5360

@@ -63,5 +70,3 @@ async def find_next_event_and_notify_core_team(client: nextcord.Client):
6370
await message.add_reaction("✅")
6471

6572
add_notification_for_date(event_date, message.id, "core_devs")
66-
67-
await add_schedule_event(next_meeting, channel.guild)

0 commit comments

Comments
 (0)