Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/m1kql/pi
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.
https://github.com/m1kql/pi
aops contest-math contests discord discord-bot discord-py docker docker-compose latex math
Last synced: about 2 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/m1kql/pi
- Owner: m1kql
- License: agpl-3.0
- Created: 2021-01-17T23:09:26.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-16T21:30:38.000Z (about 3 years ago)
- Last Synced: 2023-08-21T20:22:24.200Z (over 1 year ago)
- Topics: aops, contest-math, contests, discord, discord-bot, discord-py, docker, docker-compose, latex, math
- Language: Python
- Homepage: https://pi-bot.netlify.app
- Size: 190 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 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
- [Overview](#overview)
- [Table of contents](#table-of-contents)
- [Getting Started](#getting-started)
- [Python venv](#python-venv)
- [Docker](#docker)
- [Setup](#setup)
- [Commands](#commands)
- [Contributing](#contributing)
- [License](#license)## Getting Started
### Python venv
Make a virtual environment
```shell
$ mkdir bot && cd bot
$ python -m venv venv
$ source venv/bin/activate
```Clone the repo
```shell
$ 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.
```shell
$ echo "token=" > .env
```Change directory and run the bot.
```shell
$ cd bot/src/
$ python main.py
```### Docker
Prerequisites:
- Docker
- Docker ComposeTo run the bot:
```shell
$ 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:
- [The bot](https://github.com/yak-fumblepack/pi/tree/rewrite/bot)### 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=
bug_channel=
feature_channel=
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](https://www.gnu.org/licenses/agpl-3.0.txt) license.