Giter Site home page Giter Site logo

piston-bot's Introduction

I Run Code

Source code for the "I Run Code" Discord Bot used to run code snippets inside Discord chats.

helloworld picture

You can add me to your server here

To see a list of supported languages click here

If you have questions check by our Discord Server

engineer-man/piston is the api that actually runs the code.

How to use

Basic Syntax

/run [language]
```[syntax]
<your code>
```
  • You have to provide either language or syntax

Provide command line arguments

/run [language]
[arg1]
[arg2]
```[syntax]
<your code>
```
  • You can provide command line arguments by specifying them before the codeblock
  • Each line corresponds to one argument

Provide standard input

/run [language]
```[syntax]
<your code>
```
[input]
  • You can provide standard input by specifying it after the codeblock

Editing and deleting messages

  • You can edit your last /run message if you make a mistake and the bot will edit it's initial response.
  • You can delete the last output message (that was caused by you) with /delete or /del or by deleting your most recent /run message

Contributing

If you want to contribute you can just submit a pull request.

Code styling / IDE Settings

Please style your code according to these guidelines:

  • maximum line length is 99 columns
  • use 4 spaces for indentation
  • files end with a newline
  • lines should not have trailing whitespace

If you want to use an auto formatter please use autopep8

Example config for VSCode:

"[python]": {
    "editor.rulers": [
        99
    ],
    "editor.tabSize": 4,
},
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"editor.trimAutoWhitespace": true,
"python.formatting.provider": "autopep8",
"python.formatting.autopep8Args": ["--max-line-length", "99"],

What's new

2020-11-29

Added delete functionality.

  • The /delete or /del command will make the bot delete it's last output (that was caused by the caller)
  • If you delete your most recent /run message the corresponding output will also be deleted.

2020-08-04

Made writing rust code "snippets" easier (Thanks https://github.com/UsairimIsani)

fn main() { }

will be automatically created if it is not present in the provided code.

2020-07-16

Made writing java code "snippets" easier (Thanks https://github.com/Minecraftian14)

When typing Java code the boilerplate code for public class will be added automatically.

/run java
```
import java.util.List;
List.of(args).forEach(System.out::println);
```

will be interpreted as

/run java
```
import java.util.List;
public class temp extends Object {
  public static void main(String[] args) {
    List.of(args).forEach(System.out::println);
  }
}
```

2020-07-15

Added optional command line parameters You can use them by specifying them before the codeblock (1 per line)

Example:

/run <language>
parameter 1
parameter 2
```
<your code>
```

2021-02-05

Added optional standard input You can use standard input by specifying it after the codeblock

Example:

/run <language>
```
<your code>
```
standard input

piston-bot's People

Contributors

beaugieskens avatar brtwrst avatar dev-null-undefined avatar ethancedwards8 avatar kevrocks67 avatar lambosv avatar minecraftian14 avatar monlih avatar pyroseza avatar realtux avatar sirius902 avatar usairimisani avatar vrganj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.