Giter Club home page Giter Club logo

pi's Introduction



GitHub Workflow Status GitHub release (latest by date) GitHub Invite the bot to your discord server

Overview

Pi is a discord bot for those interested in contest math to practice their skills while engaging in a casual conversation with their fellow mathematicians or friends.

Some features include:

  • Ability to fetch problems from USAMO, USAJMO, AIME, AMC 10 & 12
  • Fully rendered problems (using LaTeX) with solution links
  • Robust points system to promote healthy competition
  • Extensible core module, simply make a pull request with your cog and we can add it in without a problem!

Note: It would be preferred if you do not host your own instance of this bot

Table of contents

Getting Started

Python venv

Make a virtual environment

$ mkdir bot && cd bot
$ python -m venv venv
$ source venv/bin/activate

Clone the repo

$ git clone https://github.com/yak-fumblepack/pi.git
$ cd pi
$ pip install -U -r requirements.txt

Add your token to the environmental variable file (.env). Make sure you are in the project's root directory.

$ echo "token=<your token without spaces and without the arrow brackets>" > .env

Change directory and run the bot.

$ cd bot/src/
$ python main.py

Docker

Prerequisites:

  • Docker
  • Docker Compose

To run the bot:

$ git clone https://github.com/yak-fumblepack/pi.git
$ sudo docker-compose up --build

Or if you don't have docker compose, build the image and run it. For more info, refer to their respective readmes:

Setup

This bot uses firebase as the database service.

Set up the .env like so (if you would like to run it using firebase):

token=<your token>
bug_channel=<channel id>
feature_channel=<channel id>
firebase_type=
firebase_project_id=
firebase_private_key_id=
firebase_private_key=
firebase_client_email=
firebase_client_id=
firebase_auth_uri=
firebase_token_uri=
firebase_auth_provider_x509_cert_url=
firebase_client_x509_cert_url=

Rememeber to omit the < >. There is no space as well.

Commands

Prefix: =

Basic Commands

Command Has Arguments Arguments Expected Output
=hello No Hello, World!
=help Yes bot, math, misc An embed showing the arguments you can pass to it to learn more about the other commands

Bot

Command Has Arguments Arguments Expected Output
=invite No Gives invite links to the support server and for the bot
=info No Gives info about this bot and other other techinical information

Math

Command Has Arguments Arguments Expected Output
=statistics Yes @user, user_id Gives an embed showing your statistics (if you leave the arguments blank) or someone else's statistics
=tex Yes tex statement Returns a rendered LaTeX statement
=amc10 Yes easy, medium, hard Gives an AMC10 problem of the selected difficulty
=amc12 Yes easy, medium, hard Gives an AMC12 problem of the selected difficulty
=cmo No Gives you a random CMO problem.
=aime No Gives you a random AIME I or II problem.
=fetch Yes contest_name year [contest id, optional] problem_number Fetches a problem from the specified path
=last5 Yes contest_name Returns the last 5 questions from a specified contest
=random No Returns a random problem
=leaderboard Yes amount of users Shows the leaderboard for the server with a specified amount of users. If it is not given, the default is 10.

Miscellaneous

Command Has Arguments Arguments Expected Output
=suggest Yes your message Allows you to make a feature suggestion or any suggestion. Needs you to complete a captcha
=report Yes your message Allows you to make a bug report or any report on an issue. Needs you to complete a captcha
=runcode Yes language code file extension Runs code from different languages.

Contributing

Features, bugfixes, issues are all greatly appreciated. Please, if you do encounter a bug, report it to us by opening an issue or even better, fix it yourself and make a pull request!

Please open a pull request or an issue on the dev branch.

License

This project is licensed under the GNU AGPL-3.0 license.

pi's People

Contributors

m1kql avatar myl989 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

mathboy346

pi's Issues

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.