1
Fork 0
mirror of https://github.com/wlinator/luminara.git synced 2024-10-02 20:23:12 +00:00

Limit XP rewards per guild to 25

This commit is contained in:
wlinator 2024-04-04 13:09:11 +02:00
parent 8d6a3ff2c3
commit e8a6db0559

View file

@ -3,6 +3,7 @@ import os
import time
from dotenv import load_dotenv
from discord.ext import commands
from db import database
@ -171,6 +172,10 @@ class XpRewardService:
return rewards
def add_reward(self, level: int, role_id: int, persistent: bool):
if len(self.rewards) >= 25:
raise commands.BadArgument("a server can't have more than 25 xp rewards.")
query = """
INSERT INTO level_rewards (guild_id, level, role_id, persistent)
VALUES (%s, %s, %s, %s)