Giter Site home page Giter Site logo

piston-bot's People

Contributors

andreasnel avatar beaugieskens avatar brikaa avatar brtwrst avatar dev-null-undefined avatar ethancedwards8 avatar gabash23 avatar jteeuwissen avatar kevrocks67 avatar lambosv avatar minecraftian14 avatar monlih avatar mrexquisite avatar pyroseza avatar realtux avatar ryleu avatar sirius902 avatar usairimisani avatar vrganj avatar zeeveez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

piston-bot's Issues

New Feature Request

Don't allow users to run their code more than once in a non bot usage channel

Many members run their code in the help channels and start playing around with it when their is #felix-run channel. For Example (don't take this personally please):

image

Therefore I suggest that someone can only run a /run command once, if the run it more than once felis will tell them something like this:
f'{user} you are only allowed to run once in a non bot-usage channel, to run more than once you go to #felix-run'

P.S: I am not good with discord.py so I won't able to implement it nicely.

Safety concerns

Hi, I found the bot on a server and had to try a bit.
Apparently you can do everything without any problems.
Things like conosle.log(process.env) are relatively harmless. Should that be executed?

When running the following code, there is no response, which leads me to believe that things are possible that shouldn't necessarily be possible.
/run python

import os
os.system("sudo shutdown")

or this command returns all processes
/run python

import os
os.system("ps -aux | less")

So there could be attacks. I have not tested curl with execution
Maybe you should have a look at it

Optional ./ command prefix

I would like to see an optional ./ command prefix, rather than just / for two main reasons:

  1. Funny *nix thing
  2. / as a prefix typically activates other bots and forces you into the native commands system

input() command for the discord bot

Hey Makers of the I run Code Bot!
Just wanted to say I admire the work you have put into the bot, it works amazingly on my server!
But i have a question/request:
Would it be possible to integrate the input() command from python into the bot so that when running the code, the bot asks for input to enter in its code?
Thank you very much
Morgan Penny

Output code-block highlighting

so that

/run csharp md

would result in

 return (
            introduction
            + '```md\n'
            + output.replace('\0', '')
            + '```'
        )

so we can format de output generated by the program. json or yaml would be good use cases too.

Suggest a language feature

When you do /run unknown-language, the bot replies with "Unsupported language: unknown-language".

In that message, I should be able to be linked to the piston issues page to request a language.

Add automatic boilerplate code for other languages

We have automatic boilerplate code for java snippets but there are other languages that could use this functionality as well.

Identify a language that requires some boilerplate code added every time and extend the codeswap.py file with automatic boilerplate for that language if it is not already present in the entered code.

Example:
when you want to run C code like this:

#include <stdio.h>
printf("hello word!");

it will not work because it needs main() {}
make it so that it is automatically added and the code will be interpreted as

#include <stdio.h>
int main() {
  printf("hello word!");
}

Output is formatted with language syntax highlighting

If I specify the syntax with the opening code fence, the bot returns its output with the same syntax highlighting. Here is a simple example:

dodgy_syntax

While I suppose this might be useful if I was writing Python code that generates more Python code, most of the time this isn't the case, and formatting the result as plaintext makes more sense.

Custom prefixes or more unique default prefix

/ is a far too common prefix and it is the leader sequence for interactions, which means one just gets in the way when you're trying to use the other, and vice-versa. Setting a more unique prefix (like irc!, ~, ##, etc) or even better, allowing for configurable prefixes would be great.

Add Guesslang

Something like #73 might work, it'd be great if the bot can scan and detect the language if no language is given/there's a typo in the language name. This library seems pretty good. https://github.com/yoeo/guesslang
Some red lines appeared when installing but it works on my machine regardless of those (they seem like just warnings).

User App Support

Reposted from engineer-man/piston#672, really sorry about the spam.

Discord now has not only support for installing bots/apps to servers, but also users. Since slash commands only allow one line and no syntax highlighting, that's pretty poor UX - so it's probably best to have a context menu command which executes whatever can be found in the message instead, maybe another which uses a dialog to allow inputting the language ID explicitly.

Run Tests in Rust.

Ability to run test like in the rust playground.

Example

```rust,test
pub fn some_func(s:&str)->String{
s.to_owned()
}
#[cfg(test)]
mod tests {
#[test]
fn test_some_func(){
use super::*;
let a = "A";
assert_eq!(String::from(a),some_func(a));
}
}
```

Change prefix or use slash commands

Right now the bot does not use slash commands and the prefix is /.
The problem with this is if you have another bot that has a slash command named run, I Run Code becomes impossible to use, as the Discord app will assume you are trying to use the run slash command.
Any attempt at sending a message starting with /run will just run the slash command.

Parse attachments as input code

Messages on discord our limited to 2,000 characters -- It would be nice if you were to get the attachment from the CDN and compile/run that

For example:

Support threads

Hello, I suggest the bot to support threads, but the current discord.py version doesn't support them. So I want to update the discord.py version to the latest.

Language list

Where can I find a list of the languages we can run with the bot?
I feel like it would be good to have that info in the README

Unsafe

so i was playing around with the bot and i realised i could run bash commands and see the file inside it
ppl could do stuff like delete the whole thing
so maybe you could make a vm to run code for saftey

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.