File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments