Added exception if the person hasn't booped anyone
This commit is contained in:
parent
0323678d67
commit
9a516b0628
|
@ -23,12 +23,15 @@ class Stats:
|
|||
await self.bot.say("{0} you have booped {1} the most amount of times, coming in at {2} times".format(
|
||||
ctx.message.author.mention, member.mention, result.get('amount')))
|
||||
config.closeConnection()
|
||||
except pymysql.ProgrammingError:
|
||||
await self.bot.say("You have not booped anyone {} Why the heck not...?".format(ctx.message.author.mention))
|
||||
except Exception as e:
|
||||
fmt = 'An error occurred while processing this request: ```py\n{}: {}\n```'
|
||||
await self.bot.say(fmt.format(type(e).__name__, e))
|
||||
|
||||
@commands.command(pass_context=True, no_pm=True)
|
||||
async def listboops(self, ctx):
|
||||
try:
|
||||
"""Lists all the users you have booped and the amount of times"""
|
||||
members = ctx.message.server.members
|
||||
cursor = config.getCursor()
|
||||
|
@ -47,6 +50,8 @@ class Stats:
|
|||
output += "\n{0.name}: {1} times".format(member,amount)
|
||||
config.closeConnection()
|
||||
await self.bot.say("```{}```".format(output))
|
||||
except pymysql.ProgrammingError:
|
||||
await self.bot.say("You have not booped anyone {} Why the heck not...?".format(ctx.message.author.mention))
|
||||
|
||||
@commands.command(pass_context=True, no_pm=True)
|
||||
async def mostwins(self, ctx):
|
||||
|
|
Loading…
Reference in a new issue