async def show_guild_stats(self, ctx):
    lookup = ('🥇', '🥈', '🥉', '🏅', '🏅')
    embed = discord.Embed(title='Server Command Stats', colour=discord.Colour.blurple())
    query = 'SELECT COUNT(*), MIN(used) FROM commands WHERE guild_id=$1;'
    count = (await ctx.db.fetchrow(query, ctx.guild.id))
    embed.description = f'{count[0]} commands used.'
    embed.set_footer(text='Tracking command usage since').timestamp = (count[1] or datetime.datetime.utcnow())
    query = 'SELECT command,\n                          COUNT(*) as "uses"\n                   FROM commands\n                   WHERE guild_id=$1\n                   GROUP BY command\n                   ORDER BY "uses" DESC\n                   LIMIT 5;\n                '
    records = (await ctx.db.fetch(query, ctx.guild.id))
    value = ('\n'.join((f'{lookup[index]}: {command} ({uses} uses)' for (index, (command, uses)) in enumerate(records))) or 'No Commands')
    embed.add_field(name='Top Commands', value=value, inline=True)
    query = 'SELECT command,\n                          COUNT(*) as "uses"\n                   FROM commands\n                   WHERE guild_id=$1\n                   AND used > (CURRENT_TIMESTAMP - INTERVAL \'1 day\')\n                   GROUP BY command\n                   ORDER BY "uses" DESC\n                   LIMIT 5;\n                '
    records = (await ctx.db.fetch(query, ctx.guild.id))
    value = ('\n'.join((f'{lookup[index]}: {command} ({uses} uses)' for (index, (command, uses)) in enumerate(records))) or 'No Commands.')
    embed.add_field(name='Top Commands Today', value=value, inline=True)
    embed.add_field(name='\u200b', value='\u200b', inline=True)
    query = 'SELECT author_id,\n                          COUNT(*) AS "uses"\n                   FROM commands\n                   WHERE guild_id=$1\n                   GROUP BY author_id\n                   ORDER BY "uses" DESC\n                   LIMIT 5;\n                '
    records = (await ctx.db.fetch(query, ctx.guild.id))
    value = ('\n'.join((f'{lookup[index]}: <@!{author_id}> ({uses} bot uses)' for (index, (author_id, uses)) in enumerate(records))) or 'No bot users.')
    embed.add_field(name='Top Command Users', value=value, inline=True)
    query = 'SELECT author_id,\n                          COUNT(*) AS "uses"\n                   FROM commands\n                   WHERE guild_id=$1\n                   AND used > (CURRENT_TIMESTAMP - INTERVAL \'1 day\')\n                   GROUP BY author_id\n                   ORDER BY "uses" DESC\n                   LIMIT 5;\n                '
    records = (await ctx.db.fetch(query, ctx.guild.id))
    value = ('\n'.join((f'{lookup[index]}: <@!{author_id}> ({uses} bot uses)' for (index, (author_id, uses)) in enumerate(records))) or 'No command users.')
    embed.add_field(name='Top Command Users Today', value=value, inline=True)
    (await ctx.send(embed=embed))
async def show_guild_stats(self, ctx):
    lookup = ('🥇', '🥈', '🥉', '🏅', '🏅')
    embed = discord.Embed(title='Server Command Stats', colour=discord.Colour.blurple())
    query = 'SELECT COUNT(*), MIN(used) FROM commands WHERE guild_id=$1;'
    count = (await ctx.db.fetchrow(query, ctx.guild.id))
    embed.description = f'{count[0]} commands used.'
    embed.set_footer(text='Tracking command usage since').timestamp = (count[1] or datetime.datetime.utcnow())
    query = 'SELECT command,\n                          COUNT(*) as "uses"\n                   FROM commands\n                   WHERE guild_id=$1\n                   GROUP BY command\n                   ORDER BY "uses" DESC\n                   LIMIT 5;\n                '
    records = (await ctx.db.fetch(query, ctx.guild.id))
    value = ('\n'.join((f'{lookup[index]}: {command} ({uses} uses)' for (index, (command, uses)) in enumerate(records))) or 'No Commands')
    embed.add_field(name='Top Commands', value=value, inline=True)
    query = 'SELECT command,\n                          COUNT(*) as "uses"\n                   FROM commands\n                   WHERE guild_id=$1\n                   AND used > (CURRENT_TIMESTAMP - INTERVAL \'1 day\')\n                   GROUP BY command\n                   ORDER BY "uses" DESC\n                   LIMIT 5;\n                '
    records = (await ctx.db.fetch(query, ctx.guild.id))
    value = ('\n'.join((f'{lookup[index]}: {command} ({uses} uses)' for (index, (command, uses)) in enumerate(records))) or 'No Commands.')
    embed.add_field(name='Top Commands Today', value=value, inline=True)
    embed.add_field(name='\u200b', value='\u200b', inline=True)
    query = 'SELECT author_id,\n                          COUNT(*) AS "uses"\n                   FROM commands\n                   WHERE guild_id=$1\n                   GROUP BY author_id\n                   ORDER BY "uses" DESC\n                   LIMIT 5;\n                '
    records = (await ctx.db.fetch(query, ctx.guild.id))
    value = ('\n'.join((f'{lookup[index]}: <@!{author_id}> ({uses} bot uses)' for (index, (author_id, uses)) in enumerate(records))) or 'No bot users.')
    embed.add_field(name='Top Command Users', value=value, inline=True)
    query = 'SELECT author_id,\n                          COUNT(*) AS "uses"\n                   FROM commands\n                   WHERE guild_id=$1\n                   AND used > (CURRENT_TIMESTAMP - INTERVAL \'1 day\')\n                   GROUP BY author_id\n                   ORDER BY "uses" DESC\n                   LIMIT 5;\n                '
    records = (await ctx.db.fetch(query, ctx.guild.id))
    value = ('\n'.join((f'{lookup[index]}: <@!{author_id}> ({uses} bot uses)' for (index, (author_id, uses)) in enumerate(records))) or 'No command users.')
    embed.add_field(name='Top Command Users Today', value=value, inline=True)
    (await ctx.send(embed=embed))