Arbitrary code execution Discord bot
Go to file
Manuel 0ecccad1c7
Update package-lock
2021-05-12 11:35:48 +02:00
src Allow file to be uploaded. Closes #3 2021-05-12 11:26:28 +02:00
.eslintrc.json update dependencies 2020-06-17 04:37:06 -04:00
.gitattributes Initial commit 2019-03-12 05:09:46 -04:00
.gitignore Initial commit 2019-03-12 05:09:46 -04:00
CHANGELOG.md make the prefix the same as the one used by the bot (#19) 2020-06-19 09:18:29 -04:00
CONTRIBUTING.md Update CONTRIBUTING.md 2020-01-03 05:25:58 -05:00
LICENSE Initial commit 2019-03-12 05:09:46 -04:00
README.md Update 'README.md' 2021-05-10 14:35:41 +02:00
config.example.json Allow file to be uploaded. Closes #3 2021-05-12 11:26:28 +02:00
package-lock.json Update package-lock 2021-05-12 11:35:48 +02:00
package.json Update dependencies 2021-05-12 11:34:35 +02:00

README.md

Compiler for Discord

Sandboxed code execution Discord bot.

Usage

$>```cpp
#include <iostream>

int main()
{
    std::cout << "Hello World!" << std::endl;
}
```
$>`py print('hello world')`

Supported Languages and Options

A supported language code is set in lang.
You can see all the possible codes using the languages command in the bot.

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

  1. Install Docker 18+
  2. Install Node 14+
  3. Install Myriad
  4. Fill out config.json
    • owner The owner(s) of the bot. Use an array for multiple owners.
    • token The bot token.
    • prefix The prefix for commands.
    • codePrefix The prefix for code evaluation.
    • myriad The port that Myriad is running on.
  5. Run npm i

Running

  1. Run myriad --config /path/to/config.yaml --languages /path/to/languages/
  2. Run node .