Arbitrary code execution Discord bot
| src | ||
| .eslintrc.json | ||
| .gitattributes | ||
| .gitignore | ||
| CHANGELOG.md | ||
| config.example.json | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
Comp_iler
Sandboxed code execution discord bot.
Invite the bot!
Usage
Code Blocks
>```lang
code
```
>options```lang
code
```
Inline Code
>`lang code`
>options`lang code`
Examples
>```cpp
#include <iostream>
int main()
{
std::cout << "Hello World!" << std::endl;
}
```
>`py print('hello world')`
Supported Languages and Options
One of the following language codes is set in lang.
Options are optionally set in options, which is a semicolon-delimited list of flag or flag=value.
aplAPLbashBashbfBrainfuckcCcljClojurecppC++csC#elixirElixirfsF#goGohsHaskelljavaJavajsJavaScriptjuliaJulialispRacketluaLuaocamlOCamlpasPascalphpPHPplPerl5prologPrologpyPythonrbRubyrsRust
How it Works
For every language there is a docker image which spins up a docker container.
The container is used for all evaluations of code, restarting if something goes wrong.
The container is locked down, so there is no networking, limited memory and CPU usage, and a time limit.
Setup
- Install Docker 18+
- Install Node 10+
- Install Myriad
- This will require Stack 2+.
- You will also have to configure Myriad, see its repository.
- Fill out
config.jsonownerThe owner(s) of the bot. Use an array for multiple owners.tokenThe bot token.prefixThe prefix for commands.codePrefixThe prefix for code evaluation.myriadThe port that Myriad is running on.
- Run
npm i
Running
- Run
myriad --config path/to/config.dhall - Run
node .