ONLINE

DiscordCompiler

discord.js

A discord compiler bot which compiles your spaghetti

DiscordCompiler Commands Prefix: ;

Report Join Support Server Github Repository

Bot Tags:

Utility

Created By: Headline#9999

Introduction

Welcome to the intro to the discord compiler bot! We designed this bot so it's usage is simple, but without sacrificing utility. If you have any questions, or something appears to be unclear, please feel free to create a ticket under the issues section of our github page linked below and we'll help you out.

Let's get started.

Commands

There are a few commands that this bot has, if you ever forget them feel free to type !help.

!languages

The first (and most important) command is this one. It shows you all the languages that this bot currently supports. The reactions underneath the post are how you navigate the menu. Clicking right moves you a page, clicking left moves you back. You can see your page number in the bottom corner.

!compilers

For languages requiring compilation, you can specify exactly which compiler you'd like to use. This can be useful for comparing errors, warning messages, or other non-standard features. If you want to use a specific compiler, remember which one you want to use from that list and keep that in mind for the next command, !compile.

!compile

This command is perhaps the most complicated, but once you get the hang of it prototyping is very simple. There are three parts to this command.

  1. !compile
    • This is the first part of the command, and indicates that we'll be compiling code!
  2. the language or compiler
    • The second argument of the !compile command is the language which you'd like to use, or the specific compiler you'd like to use for that language. If you just specify the language, it grabs the first compiler in the !compilers list.
  3. the code
    • The last part of this command is the code you'd like to execute. This is posted in code-block form for the bot to read, and for everyone to see.

The full break down of what should be typed in a discord message is exactly this.

!compile c++
```
#include <iostream>
int main ()
{
    int a = 4;
    std::cout << a << std::endl;
}
```

or, if you wish to use clang-3.8.1.

!compile clang-3.8.1
```
#include <iostream>
int main ()
{
    int a = 4;
    std::cout << a << std::endl;
}
```

Adding Compiler Options

Since the initial release, we've added support for adding further compiler options that way you can enable different features, warnings, or whatever you'd like! Here's our example message and how to format it to get warnings.

;compile c++ -std=c++17 -Wall -Wextra -O2
```cpp
#include <iostream>

int main() {
    register int a = 4;
    printf("test\n");
}
```

Giving programs input

We've also since added the ability to pipe in your own input into your programs. This can be done two ways

;compile c++ | input goes here
```
<code>
```

or

;compile c++
```
input goes here
```
```
<code>
```