Compare commits

..
Author SHA1 Message Date
imcompiling 4c40a4c0e5 Reordered to alphabetical like rest of classes.
build_develop / build (push) Successful in 1m25s
2024-09-20 21:19:23 -04:00
imcompiling c3f25b6b54 Add settings to DakinySettings.
build_develop / build (push) Has been cancelled
2024-09-20 21:18:14 -04:00
imcompiling e36b2425aa Add new tables for clan points.
build_develop / build (push) Successful in 1m24s
2024-09-20 21:15:09 -04:00
4 changed files with 27 additions and 15 deletions
+9
View File
@@ -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
View File
@@ -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)
+15
View File
@@ -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)
);
+2 -2
View File
@@ -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)