14
14
from .date_utils import add_localized_times_to_embed
15
15
16
16
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 ):
18
18
scheduled_event = get_scheduled_event_for_date (next_meeting .begin .isoformat ())
19
19
20
20
if not scheduled_event :
@@ -38,16 +38,23 @@ async def find_next_event_and_notify_core_team(client: nextcord.Client):
38
38
print ("No next meeting found" )
39
39
return
40
40
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 :
42
52
print ("Next meeting is more than 3 days away" )
43
53
return
44
54
45
55
event_date = next_meeting .begin .isoformat ()
46
56
notification = get_notification_for_date (event_date , "core_devs" )
47
57
48
- channel = client .get_channel (CORE_DEVS_CHANNEL_ID )
49
- assert isinstance (channel , nextcord .channel .TextChannel )
50
-
51
58
if not notification :
52
59
embed = nextcord .Embed (color = 5814783 )
53
60
@@ -63,5 +70,3 @@ async def find_next_event_and_notify_core_team(client: nextcord.Client):
63
70
await message .add_reaction ("✅" )
64
71
65
72
add_notification_for_date (event_date , message .id , "core_devs" )
66
-
67
- await add_schedule_event (next_meeting , channel .guild )
0 commit comments