Coder Social home page Coder Social logo

discord-bot's Introduction

Judge0Bot

Code execution in the chat

OverviewGet to the botUsageDevelopment

Overview

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.

Get to the bot

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:

  1. Invite the bot in your server. You can invite the bot in servers which you manage with this invite link.
  2. Use the bot from our support server. You can use the bot from our Judge0 support server. Join the server here.
  3. Use the bot from programming servers. The bot is included in large IT related communties. discord.py, ITBG

Usage

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.

Executing code

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.


;python

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.


;python -v

If argument -v is passed instead of source code it will return the version of the language.

Development

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:

  1. Make sure to get git and Python 3.6 or higher

This is required to clone the repository and actually run the bot.

  1. Clone the repository

git clone https://github.com/judge0/discord-bot.git

  1. Enter the directory

cd discord-bot

  1. Install Pipenv

python -m pip install pipenv

  1. Install dependencies

pipenv install --dev

  1. Run the bot

Bot token passed like command-line argument:

pipenv run start <token>

Bot token set as enviorment variable BOT_TOKEN:

pipenv run start

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.