async def encode_hex(self, ctx, *, input: commands.clean_content = None): if not input: input = await self.detect_file(ctx) await self.encryptout( ctx, "Text -> hex", binascii.hexlify(input.encode('UTF-8')) )
async def encode_ascii85(self, ctx, *, input: commands.clean_content = None): if not input: input = await self.detect_file(ctx) await self.encryptout( ctx, "Text -> ASCII85", base64.a85encode(input.encode('UTF-8')) )
async def encode_base32(self, ctx, *, input: commands.clean_content = None): if not input: input = await self.detect_file(ctx) await self.encryptout( ctx, "Text -> base32", base64.b32encode(input.encode('UTF-8')) )
async def encode_base64(self, ctx, *, input: commands.clean_content = None): """ Encode in base64 """ if not input: input = await self.detect_file(ctx) await self.encryptout( ctx, "Text -> base64", base64.urlsafe_b64encode(input.encode('UTF-8')) )
async def decode_base64(self, ctx, *, input: commands.clean_content = None): if not input: input = await self.detect_file(ctx) try: await self.encryptout(ctx, "base64 -> Text", base64.urlsafe_b64decode(input.encode('UTF-8'))) except Exception: await ctx.send("Invalid base64...")
async def decode_hex(self, ctx, *, input: commands.clean_content = None): if not input: input = await self.detect_file(ctx) try: await self.encryptout(ctx, "hex -> Text", binascii.unhexlify(input.encode('UTF-8'))) except Exception: await ctx.send("Invalid hex...")
async def decode_ascii85(self, ctx, *, input: commands.clean_content = None): if not input: input = await self.detect_file(ctx) try: await self.encryptout(ctx, "ASCII85 -> Text", base64.a85decode(input.encode('UTF-8'))) except Exception: await ctx.send("Invalid ASCII85...")
async def encode_base64(self, ctx, *, _input: clean_content = None): """ Encode in base64 """ if not _input: _input = await detect_file(ctx) await encrypt_out( ctx, "Text -> base64", base64.urlsafe_b64encode(_input.encode('UTF-8')) )
async def decode_ascii85(self, ctx, *, _input: clean_content = None): """ Decode in ASCII85 """ if not _input: _input = await detect_file(ctx) try: await encrypt_out(ctx, "ASCII85 -> Text", base64.a85decode(_input.encode('UTF-8'))) except Exception: await ctx.send("Invalid ASCII85...")
async def encode_ascii85(self, ctx, *, _input: clean_content = None): """ Encode in ASCII85 """ if not _input: _input = await detect_file(ctx) await encrypt_out( ctx, "Text -> ASCII85", base64.a85encode(_input.encode('UTF-8')) )
async def decode_hex(self, ctx, *, _input: clean_content = None): """ Decode in hex """ if not _input: _input = await detect_file(ctx) try: await encrypt_out(ctx, "hex -> Text", binascii.unhexlify(_input.encode('UTF-8'))) except Exception: await ctx.send("Invalid hex...")
async def encode_hex(self, ctx, *, _input: clean_content = None): """ Encode in hex """ if not _input: _input = await detect_file(ctx) await encrypt_out( ctx, "Text -> hex", binascii.hexlify(_input.encode('UTF-8')) )
async def decode_base32(self, ctx, *, _input: clean_content = None): """ Decode in base32 """ if not _input: _input = await detect_file(ctx) try: await encrypt_out(ctx, "base32 -> Text", base64.b32decode(_input.encode('UTF-8'))) except Exception: await ctx.send("Invalid base32...")
async def decode_base85(self, ctx, *, input: commands.clean_content = None): """ Decode in base85 """ if not input: input = await self.detect_file(ctx) try: await self.encryptout(ctx, "base85 -> Text", base64.b85decode(input.encode('UTF-8'))) except Exception: await ctx.send("Invalid base85...")
async def encode_base85(self, ctx, *, input: commands.clean_content = None): """ Encode in base85 """ if not input: input = await self.detect_file(ctx) await self.encryptout(ctx, "Text -> base85", base64.b85encode(input.encode("utf-8")))
async def decode_base32(self, ctx, *, input: commands.clean_content = None): """ Decode in base32 """ if not input: input = await self.detect_file(ctx) try: await self.encryptout(ctx, "base32 -> Text", base64.b32decode(input.encode("utf-8"))) except Exception: await ctx.send("Invalid base32...")
async def encode_hex(self, ctx, *, input: commands.clean_content = None): if not input: e = discord.Embed(description=":no_entry_sign: You must give an input string", colour=0xE74C3C) await ctx.send(embed=e) return e = discord.Embed(title="Result", colour=0x2ECC71) result = (input.encode('UTF-8').hex()).decode('utf-8') e.add_field(name="Input", value=f"`{input}`") e.add_field(name="Output", value=f"`{result}`") e.set_footer(text="Made with ❤️ by Roxiun") await ctx.send(embed=e)
async def encode_base32(self, ctx, *, txtinput: commands.clean_content): """ Encode in base32 """ await self.encryptout(ctx, "Text -> base32", base64.b32encode(txtinput.encode("UTF-8")))
async def encode_base64(self, ctx, *, input: commands.clean_content): """ Encode base64 """ await self.encryptout(ctx, "Text -> base64", base64.urlsafe_b64encode(input.encode('UTF-8')))
async def encode_ascii85(self, ctx, *, input: commands.clean_content): """ Encode in ASCII85 """ await self.encryptout( ctx, "Text -> ASCII85", base64.a85encode(input.encode('UTF-8')) )
async def encode_hex(self, ctx, *, input: commands.clean_content): """ Encode in hex """ await self.encryptout( ctx, "Text -> hex", binascii.hexlify(input.encode('UTF-8')) )
async def encode_base85(self, ctx, *, input: commands.clean_content): """ Encode in base85 """ await self.encryptout( ctx, "Text -> base85", base64.b85encode(input.encode('UTF-8')) )