From 79486a0af758464caea6da72a0a9b081f43770e5 Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Thu, 14 Jun 2018 10:31:21 -0800 Subject: [PATCH] Set claim limit to 10 --- src/cogs/bot_management.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cogs/bot_management.py b/src/cogs/bot_management.py index e2d1b51..d1580e8 100644 --- a/src/cogs/bot_management.py +++ b/src/cogs/bot_management.py @@ -20,6 +20,12 @@ class BotManager: em = discord.Embed() + if await self.bot.db_con.fetchval('select count(*) from bots where owner = $1', ctx.author.id) >= 10: + em.colour = self.bot.error_color + em.title = 'Too Many Bots Claimed' + em.description = 'Each person is limited to claiming 10 bots as that is how ' \ + 'many bots are allowed by the Discord API per user.' + return await ctx.send(embed=em) existing = await self.bot.db_con.fetchrow('select * from bots where id = $1', bot.id) if not existing: await self.bot.db_con.execute('insert into bots (id, owner, prefix) values ($1, $2, $3)',