From 729dce1ae2735a8a53f3d6ee2661ce7d0b6ab8fa Mon Sep 17 00:00:00 2001 From: aikaterna <20862007+aikaterna@users.noreply.github.com> Date: Thu, 3 Oct 2019 17:53:18 -0700 Subject: [PATCH] [Trick Or Treat] Fix totcooldown Thanks Nin. --- trickortreat/trickortreat.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/trickortreat/trickortreat.py b/trickortreat/trickortreat.py index 6a59770..d5a45f1 100644 --- a/trickortreat/trickortreat.py +++ b/trickortreat/trickortreat.py @@ -236,10 +236,12 @@ class TrickOrTreat(commands.Cog): @commands.command() async def totcooldown(self, ctx, cooldown_time: int = 0): """Set the cooldown time for trick or treating on the server.""" - cooldown = await self.config.guild(ctx.guild).cooldown() - if not cooldown_time: + if cooldown_time == 0: await self.config.guild(ctx.guild).cooldown.set(300) - await ctx.send("Trick or treating cooldown time reset to 5m.") + return await ctx.send("Trick or treating cooldown time reset to 5m.") + elif 1 <= cooldown_time <= 30: + await self.config.guild(ctx.guild).cooldown.set(30) + return await ctx.send("Trick or treating cooldown time set to the minimum of 30s.") else: await self.config.guild(ctx.guild).cooldown.set(cooldown_time) await ctx.send(f"Trick or treating cooldown time set to {cooldown_time}s.")