Add a limit to the amount of event points one can earn weekly.
This commit is contained in:
+16
-4
@@ -7,7 +7,7 @@ from discord import TextInputStyle
|
||||
from nextcord.ext import commands
|
||||
|
||||
from config import DakinyConfig
|
||||
from utils import record_event_host, record_event_participation
|
||||
from utils import record_event_points
|
||||
|
||||
|
||||
class RecordCog(commands.Cog, name="Record Commands"):
|
||||
@@ -129,14 +129,26 @@ class EventView(nextcord.ui.View):
|
||||
discord_users_list: list[str] = [
|
||||
str(user.id) for user in discord_users if user.id is not self.host_id
|
||||
]
|
||||
record_event_participation(self.config, discord_users_list, True)
|
||||
record_event_points(
|
||||
self.config,
|
||||
discord_users_list,
|
||||
True,
|
||||
self.config.params.event_participate_points,
|
||||
)
|
||||
|
||||
non_discord_users = interaction.message.embeds[0].fields[1].value
|
||||
if non_discord_users:
|
||||
non_discord_users_list: list[str] = non_discord_users.split("\n")
|
||||
record_event_participation(self.config, non_discord_users_list, False)
|
||||
record_event_points(
|
||||
self.config,
|
||||
non_discord_users_list,
|
||||
False,
|
||||
self.config.params.event_participate_points,
|
||||
)
|
||||
|
||||
record_event_host(self.config, self.host_id)
|
||||
record_event_points(
|
||||
self.config, [self.host_id], True, self.config.params.event_host_points
|
||||
)
|
||||
|
||||
event_channel: nextcord.TextChannel = interaction.guild.get_channel(
|
||||
self.config.params.event_post_channel_id
|
||||
|
||||
Reference in New Issue
Block a user