diff --git a/main.py b/main.py new file mode 100644 index 0000000..d4bd99a --- /dev/null +++ b/main.py @@ -0,0 +1,26 @@ +import discord +import asyncio +from io import StringIO +from contextlib import redirect_stdout + +print(discord.__version__) +dclient = discord.Client() + +exec_env_global = dict() +exec_env_local = dict() + +@dclient.event +async def on_message(message): + if message.content.startswith(".bbpy "): + message.content = message.content.replace(".bbpy ", "") + print(message.content) + try: + f = StringIO() + with redirect_stdout(f): + exec(message.content, exec_env_global, exec_env_local) + await message.channel.send(f.getvalue()) + except Exception as e: + await message.channel.send(type(e).__name__+str(e.args)) + + +dclient.run("NDgzNzg2NTE1NjM0MTkyNDIz.W4SPTQ.Om0LlT_Pgc7uLDNCfMvXXpPqe7k", bot=True) \ No newline at end of file