@command_history.command(name='for')
@commands.is_owner()
async def command_history_for(self, ctx, days: typing.Optional[int]=7, *, command: str):
    'Command history for a command.'
    query = 'SELECT *, t.success + t.failed AS "total"\n                   FROM (\n                       SELECT guild_id,\n                              SUM(CASE WHEN failed THEN 0 ELSE 1 END) AS "success",\n                              SUM(CASE WHEN failed THEN 1 ELSE 0 END) AS "failed"\n                       FROM commands\n                       WHERE command=$1\n                       AND used > (CURRENT_TIMESTAMP - $2::interval)\n                       GROUP BY guild_id\n                   ) AS t\n                   ORDER BY "total" DESC\n                   LIMIT 30;\n                '
    (await self.tabulate_query(ctx, query, command, datetime.timedelta(days=days)))
Command history for a command.
@command_history.command(name='for')
@commands.is_owner()
async def command_history_for(self, ctx, days: typing.Optional[int]=7, *, command: str):
    
    query = 'SELECT *, t.success + t.failed AS "total"\n                   FROM (\n                       SELECT guild_id,\n                              SUM(CASE WHEN failed THEN 0 ELSE 1 END) AS "success",\n                              SUM(CASE WHEN failed THEN 1 ELSE 0 END) AS "failed"\n                       FROM commands\n                       WHERE command=$1\n                       AND used > (CURRENT_TIMESTAMP - $2::interval)\n                       GROUP BY guild_id\n                   ) AS t\n                   ORDER BY "total" DESC\n                   LIMIT 30;\n                '
    (await self.tabulate_query(ctx, query, command, datetime.timedelta(days=days)))