Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f84e2eef29 | ||
|
|
b4eb5ab6d1 |
@@ -189,6 +189,11 @@ class SubmissionCreateButton(nextcord.ui.View):
|
||||
self, button: nextcord.ui.Button, interaction: nextcord.Interaction
|
||||
): # pylint: disable=unused-argument
|
||||
"""Button for score submission."""
|
||||
# Don't allow a user to start a new submission if one already exists
|
||||
if interaction.user.id in submission_objects:
|
||||
await interaction.send("Please finish in progress submission first.", ephemeral=True)
|
||||
return
|
||||
|
||||
guild_id_str = str(interaction.guild.id)
|
||||
guild_data = highscores_data[guild_id_str]
|
||||
|
||||
|
||||
@@ -147,11 +147,6 @@ async def submit_score(
|
||||
reverse=not boss_category_config["ascending"],
|
||||
)
|
||||
|
||||
# enforce highscore size
|
||||
while len(scores) > highscores_config["highscore_size"]:
|
||||
scores.pop()
|
||||
guild_data["tables"][boss_name]["categories"][category] = scores
|
||||
|
||||
# edit message
|
||||
highscore_channel_id = guild_data["highscore_channel_id"]
|
||||
print(f"Editting message {highscore_channel_id}")
|
||||
|
||||
Reference in New Issue
Block a user