From bbfdcdc57fc82d04122e665501fca286da0724be Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Sun, 27 Jun 2021 18:57:53 -0600 Subject: [PATCH] Change encode/decode command format --- jarvis/cogs/dev.py | 56 ++++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/jarvis/cogs/dev.py b/jarvis/cogs/dev.py index 570c690..bd26cbc 100644 --- a/jarvis/cogs/dev.py +++ b/jarvis/cogs/dev.py @@ -156,30 +156,38 @@ class DevCog(commands.Cog): if ctx.invoked_subcommand is None: await ctx.send("Usage: encode ") - @_encode.command(name="b64e") + @_encode.command(name="b64") async def _b64e(self, ctx, *, data: str): """Base64 encoding""" await ctx.send(base64.b64encode(data.encode("UTF-8")).decode("UTF-8")) - @_encode.command(name="b16e") + @_encode.command(name="b16") async def _b16e(self, ctx, *, data: str): """Base16 encoding""" - await ctx.send(base64.b16encode(data.encode("UTF-8")).decode("UTF-8")) + await ctx.send( + "`" + base64.b16encode(data.encode("UTF-8")).decode("UTF-8") + "`" + ) - @_encode.command(name="b32e") + @_encode.command(name="b32") async def _b32e(self, ctx, *, data: str): """Base32 encoding""" - await ctx.send(base64.b32encode(data.encode("UTF-8")).decode("UTF-8")) + await ctx.send( + "`" + base64.b32encode(data.encode("UTF-8")).decode("UTF-8") + "`" + ) - @_encode.command(name="a85e") + @_encode.command(name="a85") async def _a85e(self, ctx, *, data: str): """ASCII85 encoding""" - await ctx.send(base64.a85encode(data.encode("UTF-8")).decode("UTF-8")) + await ctx.send( + "`" + base64.a85encode(data.encode("UTF-8")).decode("UTF-8") + "`" + ) - @_encode.command(name="b85e") + @_encode.command(name="b85") async def _b85e(self, ctx, *, data: str): """Base85 encoding""" - await ctx.send(base64.b85encode(data.encode("UTF-8")).decode("UTF-8")) + await ctx.send( + "`" + base64.b85encode(data.encode("UTF-8")).decode("UTF-8") + "`" + ) @commands.group() async def _decode(self, ctx): @@ -187,30 +195,40 @@ class DevCog(commands.Cog): if ctx.invoked_subcommand is None: await ctx.send("Usage: decode ") - @_decode.command(name="b64d") + @_decode.command(name="b64") async def _b64d(self, ctx, *, data: str): """Base64 decoding""" - await ctx.send(base64.b64decode(data.encode("UTF-8")).decode("UTF-8")) + await ctx.send( + "`" + base64.b64decode(data.encode("UTF-8")).decode("UTF-8") + "`" + ) - @_decode.command(name="b16d") + @_decode.command(name="b16") async def _b16d(self, ctx, *, data: str): """Base16 decoding""" - await ctx.send(base64.b16decode(data.encode("UTF-8")).decode("UTF-8")) + await ctx.send( + "`" + base64.b16decode(data.encode("UTF-8")).decode("UTF-8") + "`" + ) - @_decode.command(name="b32d") + @_decode.command(name="b32") async def _b32d(self, ctx, *, data: str): """Base32 decoding""" - await ctx.send(base64.b32decode(data.encode("UTF-8")).decode("UTF-8")) + await ctx.send( + "`" + base64.b32decode(data.encode("UTF-8")).decode("UTF-8") + "`" + ) - @_decode.command(name="a85d") + @_decode.command(name="a85") async def _a85d(self, ctx, *, data: str): """ASCII85 decoding""" - await ctx.send(base64.a85decode(data.encode("UTF-8")).decode("UTF-8")) + await ctx.send( + "`" + base64.a85decode(data.encode("UTF-8")).decode("UTF-8") + "`" + ) - @_decode.command(name="b85d") + @_decode.command(name="b85") async def _b85d(self, ctx, *, data: str): """Base85 decoding""" - await ctx.send(base64.b85decode(data.encode("UTF-8")).decode("UTF-8")) + await ctx.send( + "`" + base64.b85decode(data.encode("UTF-8")).decode("UTF-8") + "`" + ) def setup(bot):