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:
parent
8d6a3ff2c3
commit
e8a6db0559
1 changed files with 5 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue