{"id":18259995,"url":"https://github.com/hungrybluedev/math-bot","last_synced_at":"2025-06-15T00:07:47.116Z","repository":{"id":109592305,"uuid":"332153909","full_name":"hungrybluedev/math-bot","owner":"hungrybluedev","description":"Discord bot that supports several math commands like sum, mean, stddev, etc.","archived":false,"fork":false,"pushed_at":"2021-01-25T14:35:11.000Z","size":361,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-08T23:44:28.804Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hungrybluedev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-23T07:33:50.000Z","updated_at":"2021-01-25T20:22:39.000Z","dependencies_parsed_at":"2023-04-14T09:02:32.458Z","dependency_job_id":null,"html_url":"https://github.com/hungrybluedev/math-bot","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/hungrybluedev/math-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungrybluedev%2Fmath-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungrybluedev%2Fmath-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungrybluedev%2Fmath-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungrybluedev%2Fmath-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hungrybluedev","download_url":"https://codeload.github.com/hungrybluedev/math-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hungrybluedev%2Fmath-bot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259901380,"owners_count":22929224,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T10:41:26.498Z","updated_at":"2025-06-15T00:07:47.094Z","avatar_url":"https://github.com/hungrybluedev.png","language":"Python","funding_links":["https://ko-fi.com/hungrybluedev","https://www.patreon.com/hungrybluedev"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=center style=\"margin: 0 auto;\"\u003e\n\u003cimg src=\"logo.png\" width=\"400px\" style=\"width: 400px;\"\u003e\n\u003c/div\u003e\n\n# Introduction\n\nA simple text-controlled Discord Bot written in Python. It can perform common math tasks, especially those geared towards randomness and simulation. You can join the test server to see the bot in action:\n\n\u003cdiv align=center style=\"margin: 0 auto;\"\u003e\n\n[![Discord](https://img.shields.io/discord/802054642812846100)](https://discord.gg/9PQHQ3ZsqE)\n\n\u003c/div\u003e\n\nIt is recommended to use the `#math-bot-test` channel to test the commands.\n\n# Usage\n\n**Example**:\n\n```\n$mathbot mean 1 2 3 4 5\n```\n\nRefer to the [documentation](docs.md) for all the supported commands and the syntax.\n\nThe source code for this bot is freely available under the [MIT License](#license). Anyone can clone this repository and host their own instance of this bot.\n\nIn case you find a bug, or notice that a certain feature is absent but want it to be added, consider looking at the [existing issues](https://github.com/hungrybluedev/math-bot/issues). If nothing matches what you found, [create a new Issue](https://github.com/hungrybluedev/math-bot/issues/new/choose).\n\n# Instructions for Local Setup\n\nThis section contains instructions that can be followed by users to have their own instance of this bot running either on their local machine. These can be adapted fairly easily and users can host their bots online on services like [Repl.it](https://repl.it/) and [Heroku](https://www.heroku.com/).\n\n## Prerequisites\n\n### Install Git and Python\n\n1. Install Python 3.8 or higher and make sure it is added to path.\n2. Install Git, add it to path and configure the username and email.\n\nA Github account is optional, but you will need it if you want to contribute code to this repository. Make sure you use the same email as in step 2.\n\n### Obtain the Source Code\n\n1. Navigate to a directory where you want to store the project.\n2. Type `git clone https://github.com/hungrybluedev/math-bot.git`\n3. Enter the newly created directory using `cd math-bot`\n\n### Obtain Discord Token\n\nFollow the relevant sections of [this tutorial](https://www.freecodecamp.org/news/create-a-discord-bot-with-python/) by **FreeCodeCamp** to obtain the required token.\n\n\u003e ⚠️ **WARNING:** Do not share this token with anyone else, especially online. Do not add it to a repository. If you have done so accidentally, you should regenerate the token immediately.\n\n### Install Dependencies\n\n1. (Optional) If you want isolation, create a virtual environment using the `virtialenv` package. Install the dependencies when the environment is active.\n2. In the root directory, run `pip install -r requirements.txt`\n\n### Prepare `.env` File\n\n1. Create a **new file** with the name `.env` in the [mathbot](mathbot) directory. This directory also contains files like [main.py](mathbot/main.py), [commands.py](mathbot/commands.py), and so on.\n2. Type `DISCORD_TOKEN=` and then paste the Discord Bot token generated in the previous step. Do not add spaces around the `=`.\n3. Ensure that this file does not appear when you type `git status` in the terminal. If it does, add `.env` in a new line in the file [.gitignore](.gitignore)\n\n## Commands\n\n### Starting the Bot\n\nNavigate to the root of the project and execute:\n\n```bash\npython -m mathbot.main\n```\n\nThe bot will log in and block inputs. In order to exit the main loop, press \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eC\u003c/kbd\u003e\n\n### Running the Unit Tests\n\nIn the root directory, execute:\n\n```bash\npython -m unittest mathbot.test\n```\n\nThis will execute all the tests present in [mathbot.test.py](mathbot/test.py)\n\n# Hosting an Instance\n\nGenerally, users might prefer hosting an instance of this bot (for free) rather than self-hosting it on their machines. Two approaches are recommended:\n\n1. Using [Repl.it](https://repl.it/) - Users can follow this [excellent tutorial](https://www.freecodecamp.org/news/create-a-discord-bot-with-python/) by **FreeCodeCamp** to learn how to host an instance of this bot for free.\n2. Using [Heroku](https://www.heroku.com/) - Another approach that might need a bit more configuration than the previous one: following [this tutorial](https://www.techwithtim.net/tutorials/discord-py/hosting-a-discord-bot-for-free/) by Tech with Tim.\n\nHowever, the instances may not stay active despite the tricks mentioned. In this case, it is better to host it on a VPS.\n\n1. Rent a VPS from a hosting provider.\n2. Harden the server, add users, set up SSH, install updates, etc.\n3. Connect via SSH.\n4. Follow the instructions in the previous sections until the part where you start the bot.\n5. Use `nohup python3 -m mathbot.main \u0026` to create a detached process where the Bot will run independent of the SSH. Note the PID stated.\n6. Kill the parent PID (generated in the previous step) when you want the Bot to stop and disconnect.\n\n# License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n# Support\n\nIf this project has been useful to you, please consider supporting me on Ko-fi or Patreon. It will help me cover the cost of hosting this bot.\n\n[\u003cimg style=\"height: 36px;\" height=\"36\" src=\"https://raw.githubusercontent.com/hungrybluedev/hungrybluedev/master/kofi.webp\"\u003e](https://ko-fi.com/hungrybluedev)\n[\u003cimg style=\"height: 36px;\" height=\"36\"  src=\"https://raw.githubusercontent.com/hungrybluedev/hungrybluedev/master/patreon.webp\"\u003e](https://www.patreon.com/hungrybluedev)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhungrybluedev%2Fmath-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhungrybluedev%2Fmath-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhungrybluedev%2Fmath-bot/lists"}