Happens daily starting 3 days before election end.
This commit is contained in:
@@ -3,7 +3,7 @@ Contains the election cycle class
|
||||
"""
|
||||
|
||||
import collections
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import nextcord
|
||||
from sqlalchemy import select
|
||||
@@ -140,6 +140,8 @@ class ElectionCycle:
|
||||
await self.election_start_action()
|
||||
elif today.date() == self.voting_start.date():
|
||||
await self.voting_start_action()
|
||||
elif (self.voting_end - timedelta(3)).date() <= today.date() < self.voting_end.date():
|
||||
await self.election_reminder()
|
||||
elif today.date() == self.voting_end.date():
|
||||
await self.voting_end_action()
|
||||
elif today.date() == self.highcouncil_election_start.date():
|
||||
@@ -273,3 +275,15 @@ class ElectionCycle:
|
||||
ElectionInformation.ElectionCycle == get_election_cycle_name(self.config)
|
||||
)
|
||||
return session.scalar(stmt)
|
||||
|
||||
async def election_reminder(self) -> None:
|
||||
"""
|
||||
Sends a message to general chat reminder clan about election.
|
||||
"""
|
||||
|
||||
general: nextcord.TextChannel = self.guild.get_channel(self.config.params.general_channel_id)
|
||||
|
||||
message = f"Reminder to <@&{self.config.params.clan_member_role_id}>! Clan elections are happening! Head over "
|
||||
message += f"to <#{self.get_election_info().ElectionChannel}> to cast your vote!"
|
||||
|
||||
await general.send(content=message)
|
||||
|
||||
Reference in New Issue
Block a user