Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code interpreter #31

Merged

Conversation

stifskere
Copy link
Contributor

Description

This PR comes with a code interpreter that runs a lot of common languages, even Brainfuck, it's contained in a module called code-interpreter inside the commands folder.

Features

image
image

The command comes with the ability to run commands from a file you may upload or directly write with command parameters.

About vulnerabilities

This command uses the Paiza API, so all the code is run by them, as this PR can't in any way run that many languages being this small...

Supported languages

  • C | C17/clang10
  • C++ | C++17/clang10
  • Java | OpenJDK18
  • Kotlin | 1.7.10/JRE18
  • Swift | 5.6.2
  • C# | Mono 6
  • Go | 1.19
  • Python 3 | 3.8.10
  • Ruby | 3.1.2p20
  • PHP | 8.1.9 cli
  • BASH | 5.0.17
  • RLang | 3.6.3
  • JavaScript | NodeJS 16.17.0
  • Visual Basic | Mono 6
  • BrainFuck
  • Cobol | cobc 2.2.0
  • F# | F# Interactive 4.0
  • Elixir | 1.12.3
  • Rust | rustc 1.59.0
  • TypeScript | 4.8.2

Other fixes

This PR also fixes a problem with the handlers, where you couldn't add sub commands or options while building a command.

enac21

This comment was marked as off-topic.

@alexcraviotto
Copy link
Contributor

I wouldn't allow running code from the bot, I haven't done a lot of digging but it may not be safe.

It uses an external API, code run outside.

@alexcraviotto alexcraviotto merged commit 89bea28 into DiscordSaaSBot:dev Mar 24, 2024
1 check passed
alexcraviotto added a commit that referenced this pull request Mar 24, 2024
* feat: response improvement stat command (#23)

* fix: naming conventions and indentation (#25)

* feat: update container action (#27)

* fix: incorrect stat count (#29)

* feat: code interpreter (#31)

* feat: interaction error handling and logging

---------

Co-authored-by: Esteve Autet Alexe <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants