Judge0Bot is a Discord bot for interacting with the Judge0 API. It executes source code of near 20 programming languages directly in the Discord channel chat.
The bot is hosted and this means that you can use its commands from a Discord server. Three of the ways of interacting with our bot in the Discord platform:
The bot is quite easy and straightforward for use. There is integrated
help command in the bot. Send
;help in the chat and the bot will send helpful
information for usage.
The code execution is done through sending a language command and passing the source code.
You can view all language commands after sending
;languages in the chat.
Every language command have three use cases (Python example):
;python print("Executing source code")
This command will execute the passed source code and it will return an output embed which includes information like time and memory usage and output which includes standart output, standart error, compiler message and sandbox message if any.
If a language command is send without source code it will return an useful guide how to pass the source code. There are three methods: passing source code in plain format, passing soure code in code block or passing source code in highlighted code block.
-v is passed instead of source code it will return the version of the language.
It is highly preferable if you don't run an instance of this bot unless you want to contribute.
The installation and running steps are as follows:
This is required to clone the repository and actually run the bot.
git clone https://github.com/judge0/discord-bot.git
python -m pip install pipenv
pipenv install --dev
Bot token passed like command-line argument:
pipenv run start <token>
Bot token set as enviorment variable BOT_TOKEN:
pipenv run start