1
0
Fork 0
mirror of synced 2024-05-07 06:02:24 +12:00

Stopped listboops from showing users not in the server the command is ran in

This commit is contained in:
Phxntxm 2016-07-09 08:34:39 -05:00
parent 92b5b7ace9
commit af7f4c8273

View file

@ -30,6 +30,7 @@ class Stats:
@commands.command(pass_context=True, no_pm=True)
async def listboops(self, ctx):
"""Lists all the users you have booped and the amount of times"""
members = ctx.message.server.members
cursor = config.connection.cursor()
cursor.execute('use {}'.format(config.db_boops))
sql = "select * from `{}`".format(ctx.message.author.id)
@ -42,7 +43,8 @@ class Stats:
for r in result:
member = find(lambda m: m.id == r['id'], self.bot.get_all_members())
amount = r['amount']
output += "\n{0.name}: {1} times".format(member,amount)
if member in members:
output += "\n{0.name}: {1} times".format(member,amount)
await self.bot.say("```{}```".format(output))
@commands.command(pass_context=True, no_pm=True)