Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c40a4c0e5 | ||
|
|
c3f25b6b54 | ||
|
|
e36b2425aa |
@@ -19,6 +19,15 @@ class ChannelIds:
|
|||||||
voting: int
|
voting: int
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class ClanPointSettings:
|
||||||
|
"""Class defines settings for Clan Points editable by Clan Council."""
|
||||||
|
|
||||||
|
points: int
|
||||||
|
verify: bool
|
||||||
|
weekly_limit: int
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Election:
|
class Election:
|
||||||
"""Class defines relevant election dates."""
|
"""Class defines relevant election dates."""
|
||||||
|
|||||||
+1
-13
@@ -5,7 +5,7 @@ from nextcord.ext import application_checks, commands
|
|||||||
|
|
||||||
from classes.election import Election
|
from classes.election import Election
|
||||||
from DakinySettings import settings
|
from DakinySettings import settings
|
||||||
from utils import GUILDS, get_active_election_cycle, get_quarter_name
|
from utils import GUILDS, get_active_election_cycle
|
||||||
|
|
||||||
ME = 206602713511886849
|
ME = 206602713511886849
|
||||||
|
|
||||||
@@ -141,15 +141,3 @@ class TestCog(commands.Cog, name="Test commands."):
|
|||||||
)
|
)
|
||||||
await cycle.term_start_action()
|
await cycle.term_start_action()
|
||||||
await interaction.send("Test command sent.", ephemeral=True)
|
await interaction.send("Test command sent.", ephemeral=True)
|
||||||
|
|
||||||
@test.subcommand()
|
|
||||||
@is_me()
|
|
||||||
async def get_quarter_name(self, interaction: nextcord.Interaction) -> None:
|
|
||||||
"""
|
|
||||||
Tests getting the quarter name.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
interaction (nextcord.Interaction): Interaction with the message.
|
|
||||||
"""
|
|
||||||
name = get_quarter_name()
|
|
||||||
await interaction.send(name)
|
|
||||||
|
|||||||
@@ -60,3 +60,18 @@ CREATE TABLE EventPointsLimit (
|
|||||||
Week varchar(7) not null,
|
Week varchar(7) not null,
|
||||||
PRIMARY KEY (UserId, Week)
|
PRIMARY KEY (UserId, Week)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE TABLE ClanPoints (
|
||||||
|
QuarterName varchar(30) not null,
|
||||||
|
UserId varchar(32) not null,
|
||||||
|
DiscordMember boolean not null,
|
||||||
|
Points int unsigned DEFAULT 0,
|
||||||
|
PRIMARY KEY (QuarterName, UserId)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE ClanPointsLimit (
|
||||||
|
UserId varchar(32) not null,
|
||||||
|
Points int unsigned DEFAULT 0,
|
||||||
|
Week varchar(7) not null,
|
||||||
|
PRIMARY KEY (UserId, Week)
|
||||||
|
);
|
||||||
@@ -48,10 +48,10 @@ def get_datetime(day: str) -> datetime:
|
|||||||
day = int(day.split("/")[1])
|
day = int(day.split("/")[1])
|
||||||
|
|
||||||
# ensure that year rolls over if current month is December and the next month is less than 12.
|
# ensure that year rolls over if current month is December and the next month is less than 12.
|
||||||
if today.month == calendar.DECEMBER and month < calendar.OCTOBER:
|
if today.month == calendar.DECEMBER and month < calendar.DECEMBER:
|
||||||
year += 1
|
year += 1
|
||||||
|
|
||||||
if today.month == calendar.JANUARY and month > calendar.MARCH:
|
if today.month == calendar.JANUARY and month > calendar.JANUARY:
|
||||||
year -= 1
|
year -= 1
|
||||||
|
|
||||||
return datetime(year, month, day, tzinfo=UTC)
|
return datetime(year, month, day, tzinfo=UTC)
|
||||||
|
|||||||
Reference in New Issue
Block a user