Add ability to configure event verification.
build_develop / build (push) Successful in 1m22s

This commit is contained in:
2024-09-07 15:14:50 -04:00
parent 87b21782ce
commit 512802def7
+23 -3
View File
@@ -160,7 +160,7 @@ class SettingsCog(commands.Cog, name="Settings Commands"):
Args:
interaction (nextcord.Interaction): Discord interaction of command.
points (nextcord.TextChannel): Number of points to set.
points (int): Number of points to set.
"""
settings.event_settings.host_points = points
settings.save()
@@ -181,12 +181,32 @@ class SettingsCog(commands.Cog, name="Settings Commands"):
Args:
interaction (nextcord.Interaction): Discord interaction of command.
points (nextcord.TextChannel): Number of points to set.
points (int): Number of points to set.
"""
settings.event_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(
self,
interaction: nextcord.Interaction,
do_verification: bool = nextcord.SlashOption( # noqa: FBT001
required=True,
description="Whether an event should be verified or not.",
),
) -> None:
"""
Sets DakinySettings event_settings.verify to the given number of points.
Args:
interaction (nextcord.Interaction): Discord interaction of command.
do_verification (bool): If the bot should verify events.
"""
settings.event_settings.verify = 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(
self,
@@ -200,7 +220,7 @@ class SettingsCog(commands.Cog, name="Settings Commands"):
Args:
interaction (nextcord.Interaction): Discord interaction of command.
points (nextcord.TextChannel): Number of points to set.
points (int): Number of points to set.
"""
settings.event_settings.weekly_limit = points
settings.save()