Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d149caafea | ||
|
|
000cb9b257 | ||
|
|
a5f0fb71e0 |
@@ -14,10 +14,14 @@ Each quarter, a channel is created here on Discord for clan members to cast thei
|
||||
**Only clan members can vote and all clan members are granted exactly one equally weighted vote.** If you vote twice for different people, your vote will be annulled.
|
||||
|
||||
All clan members are permitted to run for a seat on the Clan Council as long as they:
|
||||
**i) **have been in the clan for enough time to have participated in at least one election;
|
||||
**ii)** have no warnings under their name
|
||||
and
|
||||
**iii)** have been active (hosted 1 clan event or participate in 1 clan event) in the clan in the past 12 weeks before current election.
|
||||
|
||||
**i)** have been in the clan for at least 13 weeks (enough time to have participated in at least one election);
|
||||
|
||||
**ii)** have no warnings under their name in the last 6 months and
|
||||
|
||||
**iii)** have been active in the clan for the past 13 weeks prior to the first day of elections. To be considered active in that timeframe, one must fulfill the following criteria: hosted/participated in at least three clan events, each one in a different week;
|
||||
|
||||
**iv)** are not running under aliases that hide their true identity.
|
||||
|
||||
Candidates are permitted to vote for themselves. Once a candidate reaches 3 votes from clan members, they have earned their seat, meaning no more votes can be cast for them.
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -87,3 +87,15 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
config: DakinyConfig = self.bot.config
|
||||
cycle = ElectionCycle(get_current_cycle(config), config, self.bot.get_guild(config.params.guild_id))
|
||||
await cycle.voting_end_action()
|
||||
|
||||
@test.subcommand()
|
||||
async def election_reminder(self, interaction: nextcord.Interaction):
|
||||
config: DakinyConfig = self.bot.config
|
||||
cycle = ElectionCycle(get_current_cycle(config), config, self.bot.get_guild(config.params.guild_id))
|
||||
await cycle.election_reminder()
|
||||
|
||||
@test.subcommand()
|
||||
async def daily(self, interaction: nextcord.Interaction):
|
||||
config: DakinyConfig = self.bot.config
|
||||
cycle = ElectionCycle(get_current_cycle(config), config, self.bot.get_guild(config.params.guild_id))
|
||||
await cycle.check_date()
|
||||
|
||||
Reference in New Issue
Block a user