Compare commits
21
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ec2862aed | ||
|
|
c8f5c5bffb | ||
|
|
a56b47a5fa | ||
|
|
906b63d57f | ||
|
|
1bae320446 | ||
|
|
a081718f8d | ||
|
|
0dd1a90edd | ||
|
|
1305e15edf | ||
|
|
86e9e3e32b | ||
|
|
8498f42ba0 | ||
|
|
be46edd4ea | ||
|
|
e34d847364 | ||
|
|
50d10f5168 | ||
|
|
a01503c2c3 | ||
|
|
4c40a4c0e5 | ||
|
|
c3f25b6b54 | ||
|
|
e36b2425aa | ||
|
|
d7a0480c2b | ||
|
|
8457c09b5b | ||
|
|
3c31d0ad33 | ||
|
|
70676a98dd |
+15
-11
@@ -23,6 +23,7 @@ class ChannelIds:
|
|||||||
class Election:
|
class Election:
|
||||||
"""Class defines relevant election dates."""
|
"""Class defines relevant election dates."""
|
||||||
|
|
||||||
|
active: bool
|
||||||
election_start: str
|
election_start: str
|
||||||
highcouncil_election_announce: str
|
highcouncil_election_announce: str
|
||||||
highcouncil_election_end: str
|
highcouncil_election_end: str
|
||||||
@@ -34,16 +35,6 @@ class Election:
|
|||||||
voting_start: str
|
voting_start: str
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class EventSettings:
|
|
||||||
"""Class defines settings editable by Clan Council."""
|
|
||||||
|
|
||||||
host_points: int
|
|
||||||
participate_points: int
|
|
||||||
verify: bool
|
|
||||||
weekly_limit: int
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Params:
|
class Params:
|
||||||
"""Class defines start parameters that shouldn't be changed."""
|
"""Class defines start parameters that shouldn't be changed."""
|
||||||
@@ -53,6 +44,19 @@ class Params:
|
|||||||
guild_id: int
|
guild_id: int
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class PointSettings:
|
||||||
|
"""Class defines point settings editable by Clan Council."""
|
||||||
|
|
||||||
|
clan_points: int
|
||||||
|
clan_points_weekly_limit: int
|
||||||
|
events_weekly_limit: int
|
||||||
|
host_points: int
|
||||||
|
participate_points: int
|
||||||
|
verify_clan_points: bool
|
||||||
|
verify_events: bool
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class RoleIds:
|
class RoleIds:
|
||||||
"""Class holds all role ids needed by bot."""
|
"""Class holds all role ids needed by bot."""
|
||||||
@@ -70,8 +74,8 @@ class DakinySettings(YAMLWizard):
|
|||||||
|
|
||||||
channel_ids: ChannelIds
|
channel_ids: ChannelIds
|
||||||
election_cycles: list[Election]
|
election_cycles: list[Election]
|
||||||
event_settings: EventSettings
|
|
||||||
params: Params
|
params: Params
|
||||||
|
point_settings: PointSettings
|
||||||
role_ids: RoleIds
|
role_ids: RoleIds
|
||||||
|
|
||||||
def save(self) -> None:
|
def save(self) -> None:
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ class Election:
|
|||||||
"""
|
"""
|
||||||
self.cycle = cycle
|
self.cycle = cycle
|
||||||
self.election_cycle = settings.election_cycles[self.cycle]
|
self.election_cycle = settings.election_cycles[self.cycle]
|
||||||
|
self.active = self.election_cycle.active
|
||||||
self.election_start: datetime = get_datetime(self.election_cycle.election_start)
|
self.election_start: datetime = get_datetime(self.election_cycle.election_start)
|
||||||
self.term_start: datetime = get_datetime(self.election_cycle.term_start)
|
self.term_start: datetime = get_datetime(self.election_cycle.term_start)
|
||||||
self.term_end: datetime = get_datetime(self.election_cycle.term_end)
|
self.term_end: datetime = get_datetime(self.election_cycle.term_end)
|
||||||
|
|||||||
+15
-11
@@ -5,7 +5,7 @@ from discord import TextInputStyle
|
|||||||
from nextcord.ext import commands
|
from nextcord.ext import commands
|
||||||
|
|
||||||
from DakinySettings import settings
|
from DakinySettings import settings
|
||||||
from utils import GUILDS, MAX_DISCORD_MESSAGE_LENGTH, record_event_points
|
from utils import GUILDS, MAX_DISCORD_MESSAGE_LENGTH, PointType, record_points
|
||||||
|
|
||||||
|
|
||||||
class RecordCog(commands.Cog, name="Record Commands"):
|
class RecordCog(commands.Cog, name="Record Commands"):
|
||||||
@@ -117,16 +117,18 @@ class RecordCog(commands.Cog, name="Record Commands"):
|
|||||||
await interaction.response.send_message("Please only provide 1 recipient.", ephemeral=True)
|
await interaction.response.send_message("Please only provide 1 recipient.", ephemeral=True)
|
||||||
return
|
return
|
||||||
elif recipient is not None: # noqa: RET505
|
elif recipient is not None: # noqa: RET505
|
||||||
record_event_points(
|
record_points(
|
||||||
[str(recipient.id)],
|
[str(recipient.id)],
|
||||||
settings.event_settings.participate_points,
|
settings.point_settings.clan_points,
|
||||||
|
PointType.CLAN,
|
||||||
is_member=True,
|
is_member=True,
|
||||||
)
|
)
|
||||||
recipient_str = f"<@{recipient.id}>"
|
recipient_str = f"<@{recipient.id}>"
|
||||||
elif non_discord_recipient is not None:
|
elif non_discord_recipient is not None:
|
||||||
record_event_points(
|
record_points(
|
||||||
[non_discord_recipient],
|
[non_discord_recipient],
|
||||||
settings.event_settings.participate_points,
|
settings.point_settings.clan_points,
|
||||||
|
PointType.CLAN,
|
||||||
is_member=False,
|
is_member=False,
|
||||||
)
|
)
|
||||||
recipient_str = f'"{non_discord_recipient}"'
|
recipient_str = f'"{non_discord_recipient}"'
|
||||||
@@ -180,7 +182,7 @@ class EventView(nextcord.ui.View):
|
|||||||
Removes view and embed from recording message.
|
Removes view and embed from recording message.
|
||||||
Sends point information to database.
|
Sends point information to database.
|
||||||
"""
|
"""
|
||||||
if settings.event_settings.verify:
|
if settings.point_settings.verify_events:
|
||||||
verification_channel: nextcord.TextChannel = interaction.guild.get_channel(settings.channel_ids.admin)
|
verification_channel: nextcord.TextChannel = interaction.guild.get_channel(settings.channel_ids.admin)
|
||||||
verification_view = EventVerification(
|
verification_view = EventVerification(
|
||||||
self.event_participants.values.members, interaction.message.embeds[0].fields[1].value, self.host_id
|
self.event_participants.values.members, interaction.message.embeds[0].fields[1].value, self.host_id
|
||||||
@@ -337,18 +339,20 @@ def process_event(discord_users: list[nextcord.Member], non_discord_users: str,
|
|||||||
"""
|
"""
|
||||||
if discord_users:
|
if discord_users:
|
||||||
discord_users_list: list[str] = [str(user.id) for user in discord_users if user.id is not host_id]
|
discord_users_list: list[str] = [str(user.id) for user in discord_users if user.id is not host_id]
|
||||||
record_event_points(
|
record_points(
|
||||||
discord_users_list,
|
discord_users_list,
|
||||||
settings.event_settings.participate_points,
|
settings.point_settings.participate_points,
|
||||||
|
PointType.EVENT,
|
||||||
is_member=True,
|
is_member=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
if non_discord_users:
|
if non_discord_users:
|
||||||
non_discord_users_list: list[str] = non_discord_users.split("\n")
|
non_discord_users_list: list[str] = non_discord_users.split("\n")
|
||||||
record_event_points(
|
record_points(
|
||||||
non_discord_users_list,
|
non_discord_users_list,
|
||||||
settings.event_settings.participate_points,
|
settings.point_settings.participate_points,
|
||||||
|
PointType.EVENT,
|
||||||
is_member=False,
|
is_member=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
record_event_points([host_id], settings.event_settings.host_points, is_member=True)
|
record_points([host_id], settings.point_settings.host_points, PointType.EVENT, is_member=True)
|
||||||
|
|||||||
+77
-19
@@ -144,10 +144,67 @@ class SettingsCog(commands.Cog, name="Settings Commands"):
|
|||||||
await interaction.response.send_message(f"Voting channel set to <#{channel_id}>.", ephemeral=True)
|
await interaction.response.send_message(f"Voting channel set to <#{channel_id}>.", ephemeral=True)
|
||||||
|
|
||||||
@settings.subcommand()
|
@settings.subcommand()
|
||||||
async def event_settings(self, interaction: nextcord.Interaction) -> None:
|
async def point_settings(self, interaction: nextcord.Interaction) -> None:
|
||||||
"""Subcommand parent. Never called."""
|
"""Subcommand parent. Never called."""
|
||||||
|
|
||||||
@event_settings.subcommand(description="Sets Event Host Points value.")
|
@point_settings.subcommand(description="Sets Points value.")
|
||||||
|
async def clan_points(
|
||||||
|
self,
|
||||||
|
interaction: nextcord.Interaction,
|
||||||
|
points: int = nextcord.SlashOption(
|
||||||
|
required=True, description="Number of Clan Points the recipient earns.", min_value=0
|
||||||
|
),
|
||||||
|
) -> None:
|
||||||
|
"""
|
||||||
|
Sets DakinySettings point_settings.clan_points to the given number of points.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
interaction (nextcord.Interaction): Discord interaction of command.
|
||||||
|
points (int): Number of points to assign to PointSettings.points.
|
||||||
|
"""
|
||||||
|
settings.point_settings.clan_points = points
|
||||||
|
settings.save()
|
||||||
|
await interaction.response.send_message(f"Points set to {points}.", ephemeral=True)
|
||||||
|
|
||||||
|
@point_settings.subcommand(description="Sets Event Weekly Limit value for Clan Points.")
|
||||||
|
async def clan_points_weekly_limit(
|
||||||
|
self,
|
||||||
|
interaction: nextcord.Interaction,
|
||||||
|
points: int = nextcord.SlashOption(
|
||||||
|
required=True, description="Number of Clan Points a clan member can earn in a week.", min_value=0
|
||||||
|
),
|
||||||
|
) -> None:
|
||||||
|
"""
|
||||||
|
Sets DakinySettings point_settings.clan_points_weekly_limit to the given number of points.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
interaction (nextcord.Interaction): Discord interaction of command.
|
||||||
|
points (int): Number of points to set.
|
||||||
|
"""
|
||||||
|
settings.point_settings.clan_points_weekly_limit = points
|
||||||
|
settings.save()
|
||||||
|
await interaction.response.send_message(f"Clan Points Weekly Limit set to {points}.", ephemeral=True)
|
||||||
|
|
||||||
|
@point_settings.subcommand(description="Sets Event Weekly Limit value.")
|
||||||
|
async def events_weekly_limit(
|
||||||
|
self,
|
||||||
|
interaction: nextcord.Interaction,
|
||||||
|
points: int = nextcord.SlashOption(
|
||||||
|
required=True, description="Number of Event Points a clan member can earn in a week.", min_value=0
|
||||||
|
),
|
||||||
|
) -> None:
|
||||||
|
"""
|
||||||
|
Sets DakinySettings point_settings.events_weekly_limit to the given number of points.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
interaction (nextcord.Interaction): Discord interaction of command.
|
||||||
|
points (int): Number of points to set.
|
||||||
|
"""
|
||||||
|
settings.point_settings.events_weekly_limit = points
|
||||||
|
settings.save()
|
||||||
|
await interaction.response.send_message(f"Event Weekly Limit set to {points}.", ephemeral=True)
|
||||||
|
|
||||||
|
@point_settings.subcommand(description="Sets Event Host Points value.")
|
||||||
async def host_points(
|
async def host_points(
|
||||||
self,
|
self,
|
||||||
interaction: nextcord.Interaction,
|
interaction: nextcord.Interaction,
|
||||||
@@ -156,17 +213,17 @@ class SettingsCog(commands.Cog, name="Settings Commands"):
|
|||||||
),
|
),
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Sets DakinySettings event_settings.host_points to the given number of points.
|
Sets DakinySettings point_settings.host_points to the given number of points.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
interaction (nextcord.Interaction): Discord interaction of command.
|
interaction (nextcord.Interaction): Discord interaction of command.
|
||||||
points (int): Number of points to set.
|
points (int): Number of points to set.
|
||||||
"""
|
"""
|
||||||
settings.event_settings.host_points = points
|
settings.point_settings.host_points = points
|
||||||
settings.save()
|
settings.save()
|
||||||
await interaction.response.send_message(f"Event Host Points set to {points}.", ephemeral=True)
|
await interaction.response.send_message(f"Event Host Points set to {points}.", ephemeral=True)
|
||||||
|
|
||||||
@event_settings.subcommand(description="Sets Event Participation Points value.")
|
@point_settings.subcommand(description="Sets Event Participation Points value.")
|
||||||
async def participate_points(
|
async def participate_points(
|
||||||
self,
|
self,
|
||||||
interaction: nextcord.Interaction,
|
interaction: nextcord.Interaction,
|
||||||
@@ -177,18 +234,18 @@ class SettingsCog(commands.Cog, name="Settings Commands"):
|
|||||||
),
|
),
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Sets DakinySettings event_settings.participate_points to the given number of points.
|
Sets DakinySettings point_settings.participate_points to the given number of points.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
interaction (nextcord.Interaction): Discord interaction of command.
|
interaction (nextcord.Interaction): Discord interaction of command.
|
||||||
points (int): Number of points to set.
|
points (int): Number of points to set.
|
||||||
"""
|
"""
|
||||||
settings.event_settings.participate_points = points
|
settings.point_settings.participate_points = points
|
||||||
settings.save()
|
settings.save()
|
||||||
await interaction.response.send_message(f"Event Participation Points set to {points}.", ephemeral=True)
|
await interaction.response.send_message(f"Event Participation Points set to {points}.", ephemeral=True)
|
||||||
|
|
||||||
@event_settings.subcommand(description="Sets Event Participation Points value.")
|
@point_settings.subcommand(description="Sets whether to verify a clan point entry.")
|
||||||
async def verify(
|
async def verify_clan_points(
|
||||||
self,
|
self,
|
||||||
interaction: nextcord.Interaction,
|
interaction: nextcord.Interaction,
|
||||||
do_verification: bool = nextcord.SlashOption( # noqa: FBT001
|
do_verification: bool = nextcord.SlashOption( # noqa: FBT001
|
||||||
@@ -197,34 +254,35 @@ class SettingsCog(commands.Cog, name="Settings Commands"):
|
|||||||
),
|
),
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Sets DakinySettings event_settings.verify to the given number of points.
|
Sets DakinySettings point_settings.verify_clan_points to the given number of points.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
interaction (nextcord.Interaction): Discord interaction of command.
|
interaction (nextcord.Interaction): Discord interaction of command.
|
||||||
do_verification (bool): If the bot should verify events.
|
do_verification (bool): If the bot should verify events.
|
||||||
"""
|
"""
|
||||||
settings.event_settings.verify = do_verification
|
settings.point_settings.verify_clan_points = do_verification
|
||||||
settings.save()
|
settings.save()
|
||||||
await interaction.response.send_message(f"Event verification set to {do_verification}.", ephemeral=True)
|
await interaction.response.send_message(f"Event verification set to {do_verification}.", ephemeral=True)
|
||||||
|
|
||||||
@event_settings.subcommand(description="Sets Event Weekly Limit value.")
|
@point_settings.subcommand(description="Sets whether an event.")
|
||||||
async def weekly_limit(
|
async def verify_events(
|
||||||
self,
|
self,
|
||||||
interaction: nextcord.Interaction,
|
interaction: nextcord.Interaction,
|
||||||
points: int = nextcord.SlashOption(
|
do_verification: bool = nextcord.SlashOption( # noqa: FBT001
|
||||||
required=True, description="Number of Event Points a clan member can earn in a week.", min_value=0
|
required=True,
|
||||||
|
description="Whether an event should be verified or not.",
|
||||||
),
|
),
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Sets DakinySettings event_settings.weekly_limit to the given number of points.
|
Sets DakinySettings point_settings.verify_events to the given number of points.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
interaction (nextcord.Interaction): Discord interaction of command.
|
interaction (nextcord.Interaction): Discord interaction of command.
|
||||||
points (int): Number of points to set.
|
do_verification (bool): If the bot should verify events.
|
||||||
"""
|
"""
|
||||||
settings.event_settings.weekly_limit = points
|
settings.point_settings.verify_events = do_verification
|
||||||
settings.save()
|
settings.save()
|
||||||
await interaction.response.send_message(f"Event Weekly Limit set to {points}.", ephemeral=True)
|
await interaction.response.send_message(f"Event verification set to {do_verification}.", ephemeral=True)
|
||||||
|
|
||||||
@settings.subcommand()
|
@settings.subcommand()
|
||||||
async def role_ids(self, interaction: nextcord.Interaction) -> None:
|
async def role_ids(self, interaction: nextcord.Interaction) -> None:
|
||||||
|
|||||||
+20
-8
@@ -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_current_election_cycle
|
from utils import GUILDS, get_active_election_cycle, get_quarter_name
|
||||||
|
|
||||||
ME = 206602713511886849
|
ME = 206602713511886849
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
|||||||
interaction (nextcord.Interaction): Interaction with the message.
|
interaction (nextcord.Interaction): Interaction with the message.
|
||||||
"""
|
"""
|
||||||
cycle = Election(
|
cycle = Election(
|
||||||
get_current_election_cycle(),
|
get_active_election_cycle(),
|
||||||
self.bot.get_guild(settings.params.guild_id),
|
self.bot.get_guild(settings.params.guild_id),
|
||||||
)
|
)
|
||||||
await cycle.election_start_action()
|
await cycle.election_start_action()
|
||||||
@@ -56,7 +56,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
|||||||
interaction (nextcord.Interaction): Interaction with the message.
|
interaction (nextcord.Interaction): Interaction with the message.
|
||||||
"""
|
"""
|
||||||
cycle = Election(
|
cycle = Election(
|
||||||
get_current_election_cycle(),
|
get_active_election_cycle(),
|
||||||
self.bot.get_guild(settings.params.guild_id),
|
self.bot.get_guild(settings.params.guild_id),
|
||||||
)
|
)
|
||||||
await cycle.voting_start_action()
|
await cycle.voting_start_action()
|
||||||
@@ -72,7 +72,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
|||||||
interaction (nextcord.Interaction): Interaction with the message.
|
interaction (nextcord.Interaction): Interaction with the message.
|
||||||
"""
|
"""
|
||||||
cycle = Election(
|
cycle = Election(
|
||||||
get_current_election_cycle(),
|
get_active_election_cycle(),
|
||||||
self.bot.get_guild(settings.params.guild_id),
|
self.bot.get_guild(settings.params.guild_id),
|
||||||
)
|
)
|
||||||
await cycle.voting_end_action()
|
await cycle.voting_end_action()
|
||||||
@@ -88,7 +88,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
|||||||
interaction (nextcord.Interaction): Interaction with the message.
|
interaction (nextcord.Interaction): Interaction with the message.
|
||||||
"""
|
"""
|
||||||
cycle = Election(
|
cycle = Election(
|
||||||
get_current_election_cycle(),
|
get_active_election_cycle(),
|
||||||
self.bot.get_guild(settings.params.guild_id),
|
self.bot.get_guild(settings.params.guild_id),
|
||||||
)
|
)
|
||||||
await cycle.highcouncil_election_start_action()
|
await cycle.highcouncil_election_start_action()
|
||||||
@@ -104,7 +104,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
|||||||
interaction (nextcord.Interaction): Interaction with the message.
|
interaction (nextcord.Interaction): Interaction with the message.
|
||||||
"""
|
"""
|
||||||
cycle = Election(
|
cycle = Election(
|
||||||
get_current_election_cycle(),
|
get_active_election_cycle(),
|
||||||
self.bot.get_guild(settings.params.guild_id),
|
self.bot.get_guild(settings.params.guild_id),
|
||||||
)
|
)
|
||||||
await cycle.election_reminder()
|
await cycle.election_reminder()
|
||||||
@@ -120,7 +120,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
|||||||
interaction (nextcord.Interaction): Interaction with the message.
|
interaction (nextcord.Interaction): Interaction with the message.
|
||||||
"""
|
"""
|
||||||
cycle = Election(
|
cycle = Election(
|
||||||
get_current_election_cycle(),
|
get_active_election_cycle(),
|
||||||
self.bot.get_guild(settings.params.guild_id),
|
self.bot.get_guild(settings.params.guild_id),
|
||||||
)
|
)
|
||||||
await cycle.check_date()
|
await cycle.check_date()
|
||||||
@@ -136,8 +136,20 @@ class TestCog(commands.Cog, name="Test commands."):
|
|||||||
interaction (nextcord.Interaction): Interaction with the message.
|
interaction (nextcord.Interaction): Interaction with the message.
|
||||||
"""
|
"""
|
||||||
cycle = Election(
|
cycle = Election(
|
||||||
get_current_election_cycle(),
|
get_active_election_cycle(),
|
||||||
self.bot.get_guild(settings.params.guild_id),
|
self.bot.get_guild(settings.params.guild_id),
|
||||||
)
|
)
|
||||||
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)
|
||||||
|
|||||||
+91
-28
@@ -7,12 +7,12 @@ from sqlalchemy import select
|
|||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
|
|
||||||
from database_setup.sql_data_classes import (
|
from database_setup.sql_data_classes import (
|
||||||
EventPoints,
|
Points,
|
||||||
Presences,
|
Presences,
|
||||||
Votes,
|
Votes,
|
||||||
engine,
|
engine,
|
||||||
)
|
)
|
||||||
from utils import MAX_DISCORD_MESSAGE_LENGTH, VoteType
|
from utils import GUILDS, MAX_DISCORD_MESSAGE_LENGTH, PointType, VoteType
|
||||||
|
|
||||||
|
|
||||||
class ViewCog(commands.Cog, name="View Commands"):
|
class ViewCog(commands.Cog, name="View Commands"):
|
||||||
@@ -21,7 +21,7 @@ class ViewCog(commands.Cog, name="View Commands"):
|
|||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""Default constructor for ViewCog class. Does nothing."""
|
"""Default constructor for ViewCog class. Does nothing."""
|
||||||
|
|
||||||
@nextcord.slash_command()
|
@nextcord.slash_command(guild_ids=GUILDS)
|
||||||
async def view(self, interaction: nextcord.Interaction) -> None:
|
async def view(self, interaction: nextcord.Interaction) -> None:
|
||||||
"""Parent slash command for set. Never called."""
|
"""Parent slash command for set. Never called."""
|
||||||
|
|
||||||
@@ -49,12 +49,12 @@ class ViewCog(commands.Cog, name="View Commands"):
|
|||||||
with Session(engine) as session:
|
with Session(engine) as session:
|
||||||
if quarter_name:
|
if quarter_name:
|
||||||
ppdf = pd.read_sql_query(
|
ppdf = pd.read_sql_query(
|
||||||
sql=session.query(EventPoints).where(EventPoints.QuarterName.startswith(quarter_name)).statement,
|
sql=session.query(Points).where(Points.QuarterName.startswith(quarter_name)).statement,
|
||||||
con=engine,
|
con=engine,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
ppdf = pd.read_sql_query(
|
ppdf = pd.read_sql_query(
|
||||||
sql=session.query(EventPoints).statement,
|
sql=session.query(Points).statement,
|
||||||
con=engine,
|
con=engine,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -63,30 +63,53 @@ class ViewCog(commands.Cog, name="View Commands"):
|
|||||||
return
|
return
|
||||||
|
|
||||||
quarters = ppdf.groupby("QuarterName")
|
quarters = ppdf.groupby("QuarterName")
|
||||||
content = ""
|
content = create_points_string(interaction, quarters, PointType.EVENT)
|
||||||
for quarter in quarters.groups:
|
|
||||||
content += f"**{quarter}**\n"
|
|
||||||
unsorted_all = quarters.get_group(quarter).groupby("DiscordMember")
|
|
||||||
members = unsorted_all.get_group(name=True)
|
|
||||||
|
|
||||||
# there can be no non-discord members sometimes.
|
if len(content) > MAX_DISCORD_MESSAGE_LENGTH:
|
||||||
try:
|
await interaction.followup.send("Message length is too long, please select search to limit results.")
|
||||||
sorted_non_members = unsorted_all.get_group(name=False).sort_values(by="UserId")
|
return
|
||||||
except KeyError:
|
|
||||||
sorted_non_members = None
|
await interaction.followup.send(content=content, ephemeral=True)
|
||||||
sorted_members = members.sort_values(
|
|
||||||
by="UserId",
|
@view.subcommand(description="Show event points.")
|
||||||
key=lambda user_ids: (
|
async def clan_points(
|
||||||
[interaction.guild.get_member(int(user_id)).display_name.lower() for user_id in user_ids]
|
self,
|
||||||
),
|
interaction: nextcord.Interaction,
|
||||||
|
quarter_name: str = nextcord.SlashOption(
|
||||||
|
description="The quarter to view",
|
||||||
|
required=False,
|
||||||
|
),
|
||||||
|
) -> None:
|
||||||
|
"""
|
||||||
|
View the clan points.
|
||||||
|
|
||||||
|
Builds a message with the clan points for the quarter that matches with quarter_name.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
interaction (nextcord.Interaction): Interaction with the message.
|
||||||
|
quarter_name (str, optional): Same of quarter to autofill with. Is SlashOption.
|
||||||
|
"""
|
||||||
|
# just in case
|
||||||
|
await interaction.response.defer(ephemeral=True)
|
||||||
|
|
||||||
|
with Session(engine) as session:
|
||||||
|
if quarter_name:
|
||||||
|
ppdf = pd.read_sql_query(
|
||||||
|
sql=session.query(Points).where(Points.QuarterName.startswith(quarter_name)).statement,
|
||||||
|
con=engine,
|
||||||
)
|
)
|
||||||
sorted_all = pd.concat([sorted_members, sorted_non_members], ignore_index=True, sort=False)
|
else:
|
||||||
for row in sorted_all.itertuples():
|
ppdf = pd.read_sql_query(
|
||||||
userid = row.UserId
|
sql=session.query(Points).statement,
|
||||||
points = row.Points
|
con=engine,
|
||||||
discord_member = row.DiscordMember
|
)
|
||||||
content += f"<@{userid}>: {points}\n" if discord_member else f"{userid}: {points}\n"
|
|
||||||
content += "\n"
|
if ppdf.empty:
|
||||||
|
await interaction.followup.send(f'Quarter "{quarter_name}" is invalid.', ephemeral=True)
|
||||||
|
return
|
||||||
|
|
||||||
|
quarters = ppdf.groupby("QuarterName")
|
||||||
|
content = create_points_string(interaction, quarters, PointType.CLAN)
|
||||||
|
|
||||||
if len(content) > MAX_DISCORD_MESSAGE_LENGTH:
|
if len(content) > MAX_DISCORD_MESSAGE_LENGTH:
|
||||||
await interaction.followup.send("Message length is too long, please select search to limit results.")
|
await interaction.followup.send("Message length is too long, please select search to limit results.")
|
||||||
@@ -201,7 +224,7 @@ class ViewCog(commands.Cog, name="View Commands"):
|
|||||||
quarter_name (str): String to run autocomplete on.
|
quarter_name (str): String to run autocomplete on.
|
||||||
"""
|
"""
|
||||||
with Session(engine) as session:
|
with Session(engine) as session:
|
||||||
stmt = select(EventPoints.QuarterName).distinct()
|
stmt = select(Points.QuarterName).distinct()
|
||||||
quarters = session.scalars(stmt)
|
quarters = session.scalars(stmt)
|
||||||
|
|
||||||
# if empty compare string
|
# if empty compare string
|
||||||
@@ -213,3 +236,43 @@ class ViewCog(commands.Cog, name="View Commands"):
|
|||||||
quarter for quarter in quarters if quarter.lower().startswith(quarter_name.lower())
|
quarter for quarter in quarters if quarter.lower().startswith(quarter_name.lower())
|
||||||
]
|
]
|
||||||
await interaction.response.send_autocomplete(autofilled_quarters[:25])
|
await interaction.response.send_autocomplete(autofilled_quarters[:25])
|
||||||
|
|
||||||
|
|
||||||
|
def create_points_string(interaction: nextcord.Interaction, quarters: any, point_type: PointType) -> str:
|
||||||
|
"""
|
||||||
|
Creates the string to show how many clan/event points users have.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
interaction (nextcord.Interaction): Discord interaction of the command.
|
||||||
|
quarters (any): Pandas objects grouped by quarters.
|
||||||
|
point_type (PointType): The type of points to create the message for.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
str: The string with the message content.
|
||||||
|
"""
|
||||||
|
content: str = ""
|
||||||
|
for quarter in quarters.groups:
|
||||||
|
content += f"**{quarter}**\n"
|
||||||
|
unsorted_all = quarters.get_group(quarter).groupby("DiscordMember")
|
||||||
|
members = unsorted_all.get_group(name=True)
|
||||||
|
|
||||||
|
# there can be no non-discord members sometimes.
|
||||||
|
try:
|
||||||
|
sorted_non_members = unsorted_all.get_group(name=False).sort_values(by="UserId")
|
||||||
|
except KeyError:
|
||||||
|
sorted_non_members = None
|
||||||
|
sorted_members = members.sort_values(
|
||||||
|
by="UserId",
|
||||||
|
key=lambda user_ids: (
|
||||||
|
[interaction.guild.get_member(int(user_id)).display_name.lower() for user_id in user_ids]
|
||||||
|
),
|
||||||
|
)
|
||||||
|
sorted_all = pd.concat([sorted_members, sorted_non_members], ignore_index=True, sort=False)
|
||||||
|
for row in sorted_all.itertuples():
|
||||||
|
userid = row.UserId
|
||||||
|
points = row.EventPoints if point_type == PointType.EVENT else row.ClanPoints
|
||||||
|
discord_member = row.DiscordMember
|
||||||
|
if points > 0:
|
||||||
|
content += f"<@{userid}>: {points}\n" if discord_member else f"{userid}: {points}\n"
|
||||||
|
content += "\n"
|
||||||
|
return content
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ from classes.election import Election
|
|||||||
from DakinySettings import settings
|
from DakinySettings import settings
|
||||||
from database_setup.sql_data_classes import UserBirthday, engine
|
from database_setup.sql_data_classes import UserBirthday, engine
|
||||||
from main import birthday_list
|
from main import birthday_list
|
||||||
from utils import get_current_election_cycle
|
from utils import get_active_election_cycle
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
import nextcord
|
import nextcord
|
||||||
@@ -75,13 +75,15 @@ class DailyLoop(commands.Cog, name="Daily Loop"):
|
|||||||
Returns:
|
Returns:
|
||||||
Election: Current election cycle, None if there is no election happening.
|
Election: Current election cycle, None if there is no election happening.
|
||||||
"""
|
"""
|
||||||
cycle = get_current_election_cycle()
|
cycle = get_active_election_cycle()
|
||||||
|
|
||||||
# prevent exception from using cycle as an Int in an array
|
# prevent exception from using cycle as an Int in an array
|
||||||
if cycle is None:
|
if cycle is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return Election(cycle, self.bot.get_guild(settings.params.guild_id))
|
election = Election(cycle, self.bot.get_guild(settings.params.guild_id))
|
||||||
|
|
||||||
|
return election if election.active else None
|
||||||
|
|
||||||
def update_birthdays(self) -> None:
|
def update_birthdays(self) -> None:
|
||||||
"""Goes through database to collect all birthdays that are today. Adds user's id to birthday list."""
|
"""Goes through database to collect all birthdays that are today. Adds user's id to birthday list."""
|
||||||
|
|||||||
@@ -41,11 +41,12 @@ CREATE TABLE Presences (
|
|||||||
Presence varchar(100) not null
|
Presence varchar(100) not null
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE EventPoints (
|
CREATE TABLE Points (
|
||||||
QuarterName varchar(30) not null,
|
QuarterName varchar(30) not null,
|
||||||
UserId varchar(32) not null,
|
UserId varchar(32) not null,
|
||||||
DiscordMember boolean not null,
|
DiscordMember boolean not null,
|
||||||
Points int unsigned DEFAULT 0,
|
EventPoints int unsigned DEFAULT 0,
|
||||||
|
ClanPoints int unsigned DEFAULT 0,
|
||||||
PRIMARY KEY (QuarterName, UserId)
|
PRIMARY KEY (QuarterName, UserId)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -54,9 +55,10 @@ CREATE TABLE Messages (
|
|||||||
Id bigint unsigned not null
|
Id bigint unsigned not null
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE EventPointsLimit (
|
CREATE TABLE PointsLimit (
|
||||||
UserId varchar(32) not null,
|
UserId varchar(32) not null,
|
||||||
Points int unsigned DEFAULT 0,
|
EventPoints int unsigned DEFAULT 0,
|
||||||
|
ClanPoints int unsigned DEFAULT 0,
|
||||||
Week varchar(7) not null,
|
Week varchar(7) not null,
|
||||||
PRIMARY KEY (UserId, Week)
|
PRIMARY KEY (UserId, Week)
|
||||||
);
|
);
|
||||||
@@ -10,11 +10,11 @@ Base = automap_base()
|
|||||||
Base.prepare(autoload_with=engine)
|
Base.prepare(autoload_with=engine)
|
||||||
|
|
||||||
# define the classes
|
# define the classes
|
||||||
|
Points = Base.classes.Points
|
||||||
|
PointsLimit = Base.classes.PointsLimit
|
||||||
CouncilMembers = Base.classes.CouncilMembers
|
CouncilMembers = Base.classes.CouncilMembers
|
||||||
ElectionInformation = Base.classes.ElectionInformation
|
ElectionInformation = Base.classes.ElectionInformation
|
||||||
EventPointsLimit = Base.classes.EventPointsLimit
|
|
||||||
Messages = Base.classes.Messages
|
Messages = Base.classes.Messages
|
||||||
EventPoints = Base.classes.EventPoints
|
|
||||||
Presences = Base.classes.Presences
|
Presences = Base.classes.Presences
|
||||||
UserBirthday = Base.classes.UserBirthday
|
UserBirthday = Base.classes.UserBirthday
|
||||||
Votes = Base.classes.Votes
|
Votes = Base.classes.Votes
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ dataclass-wizard = "^0.22.3"
|
|||||||
|
|
||||||
|
|
||||||
[tool.poetry.group.dev.dependencies]
|
[tool.poetry.group.dev.dependencies]
|
||||||
ruff = "^0.6.3"
|
ruff = "^0.6.9"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core"]
|
requires = ["poetry-core"]
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ from sqlalchemy.orm import Session
|
|||||||
from DakinySettings import settings
|
from DakinySettings import settings
|
||||||
from database_setup.sql_data_classes import (
|
from database_setup.sql_data_classes import (
|
||||||
CouncilMembers,
|
CouncilMembers,
|
||||||
EventPoints,
|
|
||||||
EventPointsLimit,
|
|
||||||
Messages,
|
Messages,
|
||||||
|
Points,
|
||||||
|
PointsLimit,
|
||||||
Votes,
|
Votes,
|
||||||
engine,
|
engine,
|
||||||
)
|
)
|
||||||
@@ -30,6 +30,7 @@ MAX_DISCORD_MESSAGE_LENGTH = 2000
|
|||||||
GUILDS = [1000247361639030804, 239758371358638080]
|
GUILDS = [1000247361639030804, 239758371358638080]
|
||||||
|
|
||||||
VoteType = StrEnum("VoteType", ["COUNCIL", "DISCORDMANAGER", "CLANLEADER"])
|
VoteType = StrEnum("VoteType", ["COUNCIL", "DISCORDMANAGER", "CLANLEADER"])
|
||||||
|
PointType = StrEnum("PointType", ["CLAN", "EVENT"])
|
||||||
|
|
||||||
|
|
||||||
def get_datetime(day: str) -> datetime:
|
def get_datetime(day: str) -> datetime:
|
||||||
@@ -48,10 +49,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.DECEMBER:
|
if today.month == calendar.DECEMBER and month < calendar.OCTOBER:
|
||||||
year += 1
|
year += 1
|
||||||
|
|
||||||
if today.month == calendar.JANUARY and month > calendar.JANUARY:
|
if today.month == calendar.JANUARY and month > calendar.MARCH:
|
||||||
year -= 1
|
year -= 1
|
||||||
|
|
||||||
return datetime(year, month, day, tzinfo=UTC)
|
return datetime(year, month, day, tzinfo=UTC)
|
||||||
@@ -64,7 +65,7 @@ def get_election_name() -> str:
|
|||||||
Returns:
|
Returns:
|
||||||
str: the name of the election cycle
|
str: the name of the election cycle
|
||||||
"""
|
"""
|
||||||
cycle = get_current_election_cycle()
|
cycle = get_active_election_cycle()
|
||||||
current_cycle = settings.election_cycles[cycle]
|
current_cycle = settings.election_cycles[cycle]
|
||||||
return f"vote-{get_datetime(current_cycle.term_start).year}-{current_cycle.name}"
|
return f"vote-{get_datetime(current_cycle.term_start).year}-{current_cycle.name}"
|
||||||
|
|
||||||
@@ -82,7 +83,7 @@ def get_quarter_name() -> str:
|
|||||||
return f"{get_datetime(current_cycle.term_start).year}-{current_cycle.name}"
|
return f"{get_datetime(current_cycle.term_start).year}-{current_cycle.name}"
|
||||||
|
|
||||||
|
|
||||||
def get_current_election_cycle() -> int:
|
def get_active_election_cycle() -> int:
|
||||||
"""
|
"""
|
||||||
Returns index for active election. An election is considered active between the election start and the term start.
|
Returns index for active election. An election is considered active between the election start and the term start.
|
||||||
|
|
||||||
@@ -104,7 +105,9 @@ def get_current_election_cycle() -> int:
|
|||||||
|
|
||||||
def get_quarter_cycle() -> int:
|
def get_quarter_cycle() -> int:
|
||||||
"""
|
"""
|
||||||
Returns the index for the current cycle/quarter. Defined as between term start and end. Shouldn't return none.
|
Returns the index for the current cycle/quarter. Defined as between term start and end.
|
||||||
|
|
||||||
|
Can return None if entire year isn't covered by cycles.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
int: cycle index for current cycle.
|
int: cycle index for current cycle.
|
||||||
@@ -288,41 +291,46 @@ def decorate_dm_nomination(user_id: int, speech: str) -> str:
|
|||||||
return msg
|
return msg
|
||||||
|
|
||||||
|
|
||||||
def record_event_points(users: Sequence[str], add_points: int, *, is_member: bool) -> None:
|
def record_points(users: Sequence[str], add_points: int, point_type: PointType, *, is_member: bool) -> None:
|
||||||
"""
|
"""
|
||||||
Adds event points to all users listed.
|
Adds points to all users listed.
|
||||||
|
|
||||||
Checks if they don't exist in order to make a new entry, otherwise
|
Checks if they don't exist in order to make a new entry, otherwise
|
||||||
adds points to the existing value. Can be used for hosting or participating.
|
adds points to the existing value. Can be used for hosting or participating in events or for the clan
|
||||||
|
points.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
users (Sequence[int]): users that participated and need points.
|
users (Sequence[int]): users that participated and need points.
|
||||||
add_points (int): number of points to add
|
add_points (int): number of points to add
|
||||||
|
point_type (PointType): which point type to add to
|
||||||
is_member (bool): whether the users are a discord member or not
|
is_member (bool): whether the users are a discord member or not
|
||||||
"""
|
"""
|
||||||
quarter_name = get_quarter_name()
|
quarter_name = get_quarter_name()
|
||||||
with Session(engine) as session:
|
with Session(engine) as session:
|
||||||
for user in users:
|
for user in users:
|
||||||
stmt = select(EventPoints).where(EventPoints.UserId == user).where(EventPoints.QuarterName == quarter_name)
|
stmt = select(Points).where(Points.UserId == user).where(Points.QuarterName == quarter_name)
|
||||||
|
|
||||||
points = session.scalar(stmt)
|
points_obj = session.scalar(stmt)
|
||||||
if points is None:
|
add_points = get_allowed_points(session, point_type, user, add_points)
|
||||||
add_points = get_allowed_points(session, settings.event_settings.weekly_limit, user, add_points)
|
add_clan_points = add_points if point_type == PointType.CLAN else 0
|
||||||
new_points = EventPoints(
|
add_event_points = add_points if point_type == PointType.EVENT else 0
|
||||||
|
if points_obj is None:
|
||||||
|
new_points = Points(
|
||||||
QuarterName=quarter_name,
|
QuarterName=quarter_name,
|
||||||
UserId=user,
|
UserId=user,
|
||||||
DiscordMember=is_member,
|
DiscordMember=is_member,
|
||||||
Points=add_points,
|
EventPoints=add_event_points,
|
||||||
|
ClanPoints=add_clan_points,
|
||||||
)
|
)
|
||||||
session.add(new_points)
|
session.add(new_points)
|
||||||
else:
|
else:
|
||||||
add_points = get_allowed_points(session, settings.event_settings.weekly_limit, user, add_points)
|
points_obj.EventPoints += add_event_points
|
||||||
points.Points += add_points
|
points_obj.ClanPoints += add_clan_points
|
||||||
|
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
||||||
|
|
||||||
def get_allowed_points(session: Session, points_limit: int, user: str, points: int) -> int:
|
def get_allowed_points(session: Session, point_type: PointType, user: str, points: int) -> int:
|
||||||
"""
|
"""
|
||||||
Gets the maximum number of points a user can be given.
|
Gets the maximum number of points a user can be given.
|
||||||
|
|
||||||
@@ -332,7 +340,7 @@ def get_allowed_points(session: Session, points_limit: int, user: str, points: i
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
session (Session): Open connection to database.
|
session (Session): Open connection to database.
|
||||||
points_limit (int): Maximum number of points a user can be given in a week.
|
point_type (PointType): Which type of points to check the limit for.
|
||||||
user (str): user to be given points. Used to check a user's limit.
|
user (str): user to be given points. Used to check a user's limit.
|
||||||
points (int): maximum number of points to give to user.
|
points (int): maximum number of points to give to user.
|
||||||
|
|
||||||
@@ -342,18 +350,29 @@ def get_allowed_points(session: Session, points_limit: int, user: str, points: i
|
|||||||
# check for limit
|
# check for limit
|
||||||
today = datetime.now(tz=UTC).date()
|
today = datetime.now(tz=UTC).date()
|
||||||
this_week = f"{today.isocalendar().year}-{today.isocalendar().week}"
|
this_week = f"{today.isocalendar().year}-{today.isocalendar().week}"
|
||||||
stmt = select(EventPointsLimit).where(EventPointsLimit.UserId == user).where(EventPointsLimit.Week == this_week)
|
points_limit = (
|
||||||
|
settings.point_settings.events_weekly_limit
|
||||||
|
if point_type == PointType.EVENT
|
||||||
|
else settings.point_settings.clan_points_weekly_limit
|
||||||
|
)
|
||||||
|
stmt = select(PointsLimit).where(PointsLimit.UserId == user).where(PointsLimit.Week == this_week)
|
||||||
|
|
||||||
# if under limit, can add up to however many points would make the current limit equal to the
|
# if under limit, can add up to however many points would make the current limit equal to the
|
||||||
# allowed limit.
|
# allowed limit.
|
||||||
limit = session.scalar(stmt)
|
limit_obj = session.scalar(stmt)
|
||||||
if limit is None:
|
if limit_obj is None:
|
||||||
new_limit = EventPointsLimit(UserId=user, Points=points, Week=this_week)
|
clan_points = points if point_type == PointType.CLAN else 0
|
||||||
|
event_points = points if point_type == PointType.EVENT else 0
|
||||||
|
new_limit = PointsLimit(UserId=user, Week=this_week, EventPoints=event_points, ClanPoints=clan_points)
|
||||||
add_points = points
|
add_points = points
|
||||||
session.add(new_limit)
|
session.add(new_limit)
|
||||||
else:
|
else:
|
||||||
add_points = points if limit.Points + points <= points_limit else (max(0, points_limit - limit.Points))
|
curr_points = limit_obj.EventPoints if point_type == PointType.EVENT else limit_obj.ClanPoints
|
||||||
limit.Points += add_points
|
add_points = points if curr_points + points <= points_limit else (max(0, points_limit - curr_points))
|
||||||
|
if point_type == PointType.EVENT:
|
||||||
|
limit_obj.EventPoints += add_points
|
||||||
|
else:
|
||||||
|
limit_obj.ClanPoints += add_points
|
||||||
|
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user