From 5e8701e1f3dfa7107fff06a017e35b7727e76745 Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Sun, 27 Jun 2021 19:03:23 -0600 Subject: [PATCH] Add cloc --- jarvis/cogs/dev.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jarvis/cogs/dev.py b/jarvis/cogs/dev.py index b4f4caa..a6c4687 100644 --- a/jarvis/cogs/dev.py +++ b/jarvis/cogs/dev.py @@ -4,6 +4,7 @@ import uuid import re import ulid import base64 +import subprocess from discord.ext import commands from jarvis.utils import build_embed, convert_bytesize from jarvis.utils.field import Field @@ -230,6 +231,11 @@ class DevCog(commands.Cog): "`" + base64.b85decode(data.encode("UTF-8")).decode("UTF-8") + "`" ) + @commands.command(name="cloc", help="Get J.A.R.V.I.S. lines of code") + async def _cloc(self, ctx): + output = subprocess.check_output(["cloc", "."]).decode("UTF-8") + await ctx.send(f"```\n{output}\n```") + def setup(bot): bot.add_cog(DevCog(bot))