Git Product home page Git Product logo

arcoexbot's People

Contributors

a-arpit94 avatar acorrenson avatar benda1997 avatar beothorn avatar danielsauve avatar hoenn avatar j-setiawan avatar kurolox avatar wadie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

arcoexbot's Issues

Rewrite the code

Right now the code is not really well written and I'd like to make language addition easier without having to edit the main file by adding extra language as new files. I'd also like to make a new compile() function that will run the compiler for compiled languages and check if there's any error.

Argument detection doesn't work properly

I need to rewrite the check_lang() function because it does have a few problems. The most important one is that the bot doesn't give priority to the optional language argument if there's also a syntax markdown language specified in the code block, so you can't use syntax markdown with some languages (ie: trying to use guile, which uses lisp markdown)

Output compilers to STDERR

Right now if something fails in a compiled language (Rust, C++) there will be no output, so the user won't know what failed. Since the compilers go silent if there are no issues, adding their output to STDERR should fix the issue.

Compiled languages run the same program every time

For instance, asking the bot to run a Haskell program will return "À" no matter what the code is, even if it's not a valid program. Similar behavior occurs for Rust, but not for Python.

My guess is that the bot saves input to the same file every time, but it's now failing to overwrite the old version for compiled languages, so we keep getting the output of an old program.

If compiler output is colored, it will look broken on discord

Right now it looks like this.

�[01m�[K/bot/code/cpp/exec/plaincode.cpp:2:1:�[m�[K �[01;31m�[Kerror: �[m�[K'�[01m�[Kajdajdkasjkd�[m�[K' does not name a type
 �[01;31m�[Kajdajdkasjkd�[m�[K
 �[01;31m�[K^~~~~~~~~~~~�[m�[K

R is showing some extra output that shouldn't be there

As far as I know, this is caused because inside the sandbox the environment variables are different than the host, and R might need something that's causing it to show all the extra output. The language works, it's just that it shows some garbage. This is an example of output created by a hello world.

/usr/lib/R/bin/R: line 238: /usr/lib/R/etc/ldpaths: No such file or directory
cannot find system Renviron
Error : .onLoad failed in loadNamespace() for 'utils', details:
  call: options(op.utils[toset])
  error: invalid value for 'editor'
Error : .onLoad failed in loadNamespace() for 'utils', details:
  call: options(op.utils[toset])
  error: invalid value for 'editor'
In addition: Warning message:
package ‘utils’ in options("defaultPackages") was not found 
During startup - Warning message:
package ‘stats’ in options("defaultPackages") was not found 
[1] "Hello, World!"

Write documentation

Writting a README.md both in the root and in the languages folder for the .json template are a few things that I still have to do.

Update languages supported documentation

I've added some languages, but I haven't updated the documentation for them, and some require a few workarounds and bash scripts that I should add to the documentation.

Bot doesn't work properly when launched from a systemd unit file

I'm completely lost on this one. It seems that if the bot is being launched by a systemd unit file or anything similar (cron jobs, for example) the bot misbehaves, making his output unpredictable. Sometimes he won't output anything, but sometimes it will work, and sometimes it will work partially.

Here are a few images explaining this misbehavior.



None of this behavior happens if the bot is launched manually (either from the computer itself, or through ssh), making this issue extremely hard to debug. I'll appreciate any hint about what could be happening, and I'm more than happy to provide any information that could be relevant.

Make bot instructions better

Right now the language list is hardcoded and it can get spammy. Replacing the general message to a private PM and making the bot autodetect the supported languages would make it better.

Any extra ` at the start of the code block will make the bot malfunction

When a language is specified via argument and there are more than 3 ` in the start of the code block, any extra will be passed as code, causing errors like in the following example.

/bot/code/bash/28-08-2017_17:25:40.984310.sh: line 1: unexpected EOF while looking for matching ``'
/bot/code/bash/28-08-2017_17:25:40.984310.sh: line 3: syntax error: unexpected end of file

If there's no argument, and the language is set via syntax markdown, the language won't be recognized.

Folders don't get created automatically

Due to the nature of the manually added languages, all of the paths used for them must be manually created. Otherwise, the bot will complain about files not being found (because there's not a directory to put them), so forcing the bot to create the directories or check if they already exist should be straightforward.

Add .gitignore

There are a lot of files that should be ignore. Just to list a few:

  • All python virtualenv directories
  • botlog
  • credentials.py
  • startbot.sh script
  • All of the folders with the bot code snippets

Make use of exit codes to check if things are behaving as expected

Right now the bot depends only on the stdout and stderr to know if things went well (if there's any output while compiling, the bot will assume that there was a problem and it will return the compiler output without executing the binary, even if it was just a warning.)

Adding support for checking the exit code of the subprocess would improve the bot and make it more flexible.

Keep growing the supported language list

Greetings to everyone who finds this project!

Last year hacktoberfest got me started in the world of open source, and I want to contribute by helping people to get their pull requests.

So, this task should be easy for the most part. The only thing you have to do is check the list of supported languages in the bot here, find a language that is not in the list and make a .json file following the instructions there.

Since getting the sandbox might be hard in order to set up the bot for testing purposes, I'd recommend to use the nosandbox branch. Be careful with it though, because everyone who uses the bot would be getting access to your computer. As long as you use the bot in a private server where you are alone, there shouldn't be any problem.

Feel free to ask me any doubts, or even make new issues to improve the documentation if you feel like something would be missing. Any help is appreciated.

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.