Skip to content

Commit af10e92

Browse files
authored
Add files via upload
1 parent 8363b0a commit af10e92

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

cogs/q.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import discord, base64, brainfuck #pip install brainfuck-interpreter
2+
from discord.ext import commands
3+
4+
class ex(commands.Cog):
5+
def __init__(self, client:commands.Bot):
6+
self.client = client
7+
8+
@commands.command(name="decode")
9+
async def a(self, c, *, data):
10+
if c == "bin" or c == "binary":
11+
d = str()
12+
for i in data.split():
13+
a = int(i, 2)
14+
d += chr(a)
15+
return await ctx.reply(d)
16+
elif c == "hex" or c == "hexadecimal":
17+
return await ctx.reply(bytearray.fromhex(data).decode())
18+
elif c == "base32":
19+
return await ctx.reply(base64.b32decode(data).decode("UTF-8"))
20+
elif c == "base64":
21+
return await ctx.reply(base64.b64decode(data).decode("UTF-8"))
22+
elif c == "bf" or c == "brainfk" or c == "brainfuck":
23+
return await ctx.reply(brainfuck.evaluate(data))
24+
else: raise BadArgument

0 commit comments

Comments
 (0)