exec - run code straight from Discord
Invite the botcheck the code, or keep reading to see what it does
exec supports Python, Go, C, Rust, Bash, NodeJS, and C++.
Each execution runs completely isolated in its own container, detached from all networks, for a maximum of 45 seconds.
Usage
To run a snippet, type execute  (note the space) followed by a syntax-highlighted code block.
Once the code is finished executing, the entire .log file will be posted.
exec demonstration
Code wrapping
If you do not explicitly declare main() in your C, Go, or Rust code, exec will wrap it for you. Of course, if you declare main(), exec will run it as-is.
// input.c
printf("exec is awesome!\n");

// ----------
// input.c (wrapped)
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

int main() {
    printf("exec is awesome!\n");
}
// input.go
fmt.Printf("exec is awesome!\n")

// ----------
// input.go (wrapped)
package main

import (
    "fmt"
    "math"
    "strings"
)

var _, _ = fmt.Printf("")
var _ = math.Abs(1)
var _ = strings.ToLower("")

func main() {
    fmt.Printf("exec is awesome!\n")
}
// input.rs
println!("exec is awesome!");

// ----------
// input.rs (wrapped)
fn main() {
    println!("exec is awesome!");
}
// input.cpp
cout << "exec is awesome!" << endl;

// ----------
// input.cpp (wrapped)
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <cstring>
using namespace std;

int main() {
    cout << "exec is awesome!" << endl;
}
Ready to try exec?
Back to Home