@commands.command(hidden=True)
@commands.is_owner()
async def commandstats(self, ctx, limit=20):
    'Shows command stats.\n\n        Use a negative number for bottom instead of top.\n        This is only for the current session.\n        '
    counter = self.bot.command_stats
    width = len(max(counter, key=len))
    total = sum(counter.values())
    if (limit > 0):
        common = counter.most_common(limit)
    else:
        common = counter.most_common()[limit:]
    output = '\n'.join((f'{k:<{width}}: {c}' for (k, c) in common))
    (await ctx.send(f'''```
{output}
```'''))
Shows command stats.

Use a negative number for bottom instead of top.
This is only for the current session.
@commands.command(hidden=True)
@commands.is_owner()
async def commandstats(self, ctx, limit=20):
    'Shows command stats.\n\n        Use a negative number for bottom instead of top.\n        This is only for the current session.\n        '
    counter = self.bot.command_stats
    width = len(max(counter, key=len))
    total = sum(counter.values())
    if (limit > 0):
        common = counter.most_common(limit)
    else:
        common = counter.most_common()[limit:]
    output = '\n'.join((f'{k:<{width}}: {c}' for (k, c) in common))
    (await ctx.send(f'```
{output}
```'))