make the math problem only accept integers
@@ -51,17 +51,17 @@ class Econ(commands.Cog):
mine_commands = self.d.miners.get(ctx.author.id, 0)
self.d.miners[ctx.author.id] = mine_commands + 1
- if mine_commands >= 100*source_multi:
+ if True:
prob = f'{random.randint(0, 45)}{random.choice(("+", "+",))}{random.randint(0, 25)}'
prob = (prob, str(eval(prob)),)
await self.bot.send(ctx, ctx.l.econ.math_problem.problem.format(prob[0]))
- def author_check(m):
- return m.channel.id == ctx.channel.id and m.author.id == ctx.author.id
+ def check(m):
+ return m.channel.id == ctx.channel.id and m.author.id == ctx.author.id and m.content.isdigit()
try:
- m = await self.bot.wait_for('message', check=author_check, timeout=10)
+ m = await self.bot.wait_for('message', check=check, timeout=10)
except asyncio.TimeoutError:
await self.bot.send(ctx, ctx.l.econ.math_problem.timeout)
return False
