Overview • Get to the bot • Usage • Development
Judge0Bot is a Discord bot for interacting with the Judge0 API. It executes code from nearly 20 programming languages directly in your Discord server.
The bot is hosted and this means that you can use its commands in a Discord server. There are three ways of interacting with our bot on Discord:
- Add the bot to your own server. You can add the bot to servers where you have the Manage Server permmision with this link.
- Use the bot in our support server. You can use the bot in the Judge0 support server. Join the server here.
- Use the bot in major programming servers. The bot is included in large IT related communties like discord.py and ITBG!
The bot is quite easy to use. Send ;help
in the chat and the bot will give you helpful information for usage.
Code execution is done through sending a language command with the code you want to execute.
You can view all supported languages by sending ;languages
in the chat.
Every language command has three use cases (Python is used here as an example):
;python print("Executing source code")
This command executes the code provided andreturns an embed which includes information like the time it took to execute, memory usage and the code's output including standart output, standart error, compiler messages and sandbox messages (if any).
;python
If a language command is sebt without any code it will return an useful guide on how to pass the code. There are three methods: passing the code in plain text, passing the code in a code block or passing the code in a highlighted code block.
;python -v
If -v
is passed instead of source code it will return the version of the language Judge0 is using.
It is highly prefered if you don't run an instance of this bot unless you want to contribute.
The installation and running steps are as follows:
- Make sure to get git and Python 3.6 or higher
This is required to clone the repository and run the bot.
- Clone the repository
git clone https://github.com/judge0/discord-bot.git
- Go to the directory
cd discord-bot
- Install Pipenv
python -m pip install pipenv
- Install the required dependencies
pipenv install --dev
- Run the bot
Set the bot token as enviorment variable (BOT_TOKEN): Set the Rapid API auth key as enviorment variable (AUTH_KEY): Get your auth key from here: Judge0 Rapid API
pipenv run start