Open Jimmacle opened 7 years ago
Are you working on this? Because i already have a lot of code for exactly this. We just need to secure it.
Is something like this what you had in mind? http://www.mono-project.com/docs/tools+libraries/tools/repl/
It's pretty straightforward to implement and I can contribute (including role checks.)
@CsharpOnLinuxDev The idea would be to just have stuff like
~run
Console.WriteLine("Hello World");
Would it be better to have a delimiter so a larger snippet could be executed like so?
~run ~ for (int A = 0; A < 10; A++) { Console.WriteLine(A); A++; } ~
A more elegant solution would be to put it in a code block, as in triple backticks.
If you want to expand this beyond C# it may be a good idea to take a page from Reddit's compilebot, which uses the Ideone API to compile/run - that would solve the security problem, since they have their own security built in.
You can put the language name in a codeblock to identify which language to compile under.
```csharp
Console.WriteLine("Hello World");
```
It would be nice to be able to compile and run small code snippets from within Discord and have it send the console feedback when it completes. I already have progress on a system for it so I can help put it into the bot once I make it safe to use.