This commit is contained in:
+74
-16
@@ -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)
|
||||
|
||||
@settings.subcommand()
|
||||
async def event_settings(self, interaction: nextcord.Interaction) -> None:
|
||||
async def point_settings(self, interaction: nextcord.Interaction) -> None:
|
||||
"""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 PointSettings.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 event_settings.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 event_settings.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(
|
||||
self,
|
||||
interaction: nextcord.Interaction,
|
||||
@@ -162,11 +219,11 @@ class SettingsCog(commands.Cog, name="Settings Commands"):
|
||||
interaction (nextcord.Interaction): Discord interaction of command.
|
||||
points (int): Number of points to set.
|
||||
"""
|
||||
settings.event_settings.host_points = points
|
||||
settings.point_settings.host_points = points
|
||||
settings.save()
|
||||
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(
|
||||
self,
|
||||
interaction: nextcord.Interaction,
|
||||
@@ -183,12 +240,12 @@ class SettingsCog(commands.Cog, name="Settings Commands"):
|
||||
interaction (nextcord.Interaction): Discord interaction of command.
|
||||
points (int): Number of points to set.
|
||||
"""
|
||||
settings.event_settings.participate_points = points
|
||||
settings.point_settings.participate_points = points
|
||||
settings.save()
|
||||
await interaction.response.send_message(f"Event Participation Points set to {points}.", ephemeral=True)
|
||||
|
||||
@event_settings.subcommand(description="Sets Event Participation Points value.")
|
||||
async def verify(
|
||||
@point_settings.subcommand(description="Sets whether to verify a clan point entry.")
|
||||
async def verify_clan_points(
|
||||
self,
|
||||
interaction: nextcord.Interaction,
|
||||
do_verification: bool = nextcord.SlashOption( # noqa: FBT001
|
||||
@@ -203,28 +260,29 @@ class SettingsCog(commands.Cog, name="Settings Commands"):
|
||||
interaction (nextcord.Interaction): Discord interaction of command.
|
||||
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()
|
||||
await interaction.response.send_message(f"Event verification set to {do_verification}.", ephemeral=True)
|
||||
|
||||
@event_settings.subcommand(description="Sets Event Weekly Limit value.")
|
||||
async def weekly_limit(
|
||||
@point_settings.subcommand(description="Sets whether an event.")
|
||||
async def verify_events(
|
||||
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
|
||||
do_verification: bool = nextcord.SlashOption( # noqa: FBT001
|
||||
required=True,
|
||||
description="Whether an event should be verified or not.",
|
||||
),
|
||||
) -> None:
|
||||
"""
|
||||
Sets DakinySettings event_settings.weekly_limit to the given number of points.
|
||||
Sets DakinySettings event_settings.verify to the given number of points.
|
||||
|
||||
Args:
|
||||
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()
|
||||
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()
|
||||
async def role_ids(self, interaction: nextcord.Interaction) -> None:
|
||||
|
||||
Reference in New Issue
Block a user