def command_stats(self, ctx, limit: int=10):
"""Show most used commands."""
if limit > 20 or limit < 1:
await ctx.send('no')
return
cur = self.cstats_coll.find().sort('uses',
direction=pymongo.DESCENDING)\
.limit(limit)
res = []
async for single in cur:
if single.get('t'):
continue
name, uses = single['name'], single['uses']
res.append(f'{name}: used {uses} times')
_res = '\n'.join(res)
await ctx.send(f'```\n{_res}\n```')
评论列表
文章目录