-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sincere Singularities #8
Open
janine9vn
wants to merge
58
commits into
main
Choose a base branch
from
sincere-singularities
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
2715880
Initial commit
Vinyzu 99495f4
Set up
koviubi56 191a013
Fix pre-commit
koviubi56 a0756e0
Merge pull request #1 from koviubi56/main
Vinyzu fa8c3bb
Basic Setup of Disnake
Vinyzu e786085
Merge pull request #2 from SincereSingularities/vinyzu-dev
Vinyzu e4e6b1e
Package code and clean up (#3)
koviubi56 3344b7b
Restaurant Chooser View (#4)
Vinyzu 4bb742c
Restaurant Select Improvements (#5)
Vinyzu 5e6412c
GUI based Orders are almost done. (#8)
Vinyzu 5aa704b
Add `check_similarity` (#7)
koviubi56 146d931
Implement Content Checks. (#9)
Vinyzu 369c8cb
Add generate_random_avatar_url (#10)
koviubi56 fbf0341
Order Queue System (#11)
Vinyzu 9f42715
Game Quality of Life Improvements (#12)
Vinyzu a08ecb2
Add points and buying restaurants (#13)
koviubi56 e6b31c3
Order Conditions (#14)
Vinyzu 0697bd5
Various Game Improvements (#15)
Vinyzu 425c5e6
Refactoring (#16)
koviubi56 c50d5e1
Various Quality of Life Improvements (#17)
Vinyzu f82b672
Add automatic difficulty changing (#18)
koviubi56 360c2f0
Add condition frequency based on difficulty (#19)
koviubi56 7a11b7a
Linting: Applied opinionated Black Formatting (#20)
Vinyzu fdccd62
Save Customer Information reload in Modal (#21)
Vinyzu 0fb9477
Add Customer Id to Order Description (#22)
Vinyzu 402f706
Fix Wording/Spelling Errors (#23)
Vinyzu 805db73
[WIP] New Feature: Add database functionality (#6)
WassCodeur f9c4dfe
Fix Condition Messages (#24)
Vinyzu c449cab
Rename Extra Information to Extra Wish
Vinyzu a068415
Merge pull request #25 from Vinyzu/main
Vinyzu 5a06b42
Various Game Improvements (#28)
Vinyzu d0cbb74
Add Game Title
Vinyzu 887f927
Merge pull request #29 from Vinyzu/main
Vinyzu 36d72a8
Save Customer Information to fill-in even if wrong OrderID (#30)
Vinyzu f9a776e
Add introduction
koviubi56 6d12dca
Merge pull request #31 from koviubi56/main
Vinyzu fdf5bbf
Rework Coin Buy Menu if you dont have enough coins
Vinyzu 2f01d8f
Merge pull request #32 from Vinyzu/main
Vinyzu 5eba445
Delete fixed TODOs
Vinyzu 269301c
Merge branch 'SincereSingularities:main' into main
Vinyzu e9801a7
Merge pull request #33 from Vinyzu/main
Vinyzu 2e7f1a8
Add Restaurant Colors
Vinyzu c50f0fe
Merge branch 'SincereSingularities:main' into main
Vinyzu e6dbbdc
Merge pull request #34 from Vinyzu/main
Vinyzu be205e4
ReadMe Presentation/Documentation
Vinyzu ab83b4b
Merge branch 'SincereSingularities:main' into main
Vinyzu 13cb14a
Fix Formatting/Linting
Vinyzu d9d6db5
Merge branch 'main' of https://github.com/Vinyzu/SincereSingularities
Vinyzu c486911
Fix empty line
Vinyzu 3440fa5
Fix trailing whitespace
Vinyzu 3700ac6
Merge pull request #35 from Vinyzu/main
Vinyzu 0416b4d
Improve ReadMe Presentation (#36)
Vinyzu a2618f6
Add Video Description and Authors Pfp (#37)
Vinyzu c09328f
Add Preview Images (#38)
Vinyzu d2a8127
Add Helper Commands Documentation (#39)
Vinyzu 08db560
Fix Order Preview Img URLs
Vinyzu 87f8b30
Merge pull request #40 from Vinyzu/main
FoxFil 34ef151
Add 'sincere-singularities/' from commit '87f8b30ff2f5841511078d843a1…
janine9vn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
BOT_TOKEN= | ||
|
||
DB_HOST="172.17.0.2" | ||
DB_PORT="27017" | ||
DB_NAME = "bot_db" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# GitHub Action workflow enforcing our code style. | ||
|
||
name: Lint | ||
|
||
# Trigger the workflow on both push (to the main repository, on the main branch) | ||
# and pull requests (against the main repository, but from any repo, from any branch). | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
# Brand new concurrency setting! This ensures that not more than one run can be triggered for the same commit. | ||
# It is useful for pull requests coming from the main repository since both triggers will match. | ||
concurrency: lint-${{ github.sha }} | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
# The Python version your project uses. Feel free to change this if required. | ||
PYTHON_VERSION: "3.11" | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ env.PYTHON_VERSION }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Run pre-commit hooks | ||
uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Files generated by the interpreter | ||
__pycache__/ | ||
*.py[cod] | ||
|
||
# Environment specific | ||
.venv | ||
venv | ||
.env | ||
env | ||
|
||
# Unittest reports | ||
.coverage* | ||
|
||
# Logs | ||
*.log | ||
|
||
# PyEnv version selector | ||
.python-version | ||
|
||
# Built objects | ||
*.so | ||
dist/ | ||
build/ | ||
|
||
# Distribution / packaging | ||
*.egg-info/ | ||
|
||
# IDEs | ||
# PyCharm | ||
.idea/ | ||
# VSCode | ||
.vscode/ | ||
# MacOS | ||
.DS_Store | ||
|
||
# json files for test cases | ||
orders.json | ||
states.json | ||
|
||
# MyPy | ||
.mypy_cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Pre-commit configuration. | ||
# See https://github.com/python-discord/code-jam-template/tree/main#pre-commit-run-linting-before-committing | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-ast | ||
- id: check-case-conflict | ||
- id: check-json | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
args: [--markdown-linebreak-ext=md] | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.5.2 | ||
hooks: | ||
- id: ruff | ||
args: [--fix] | ||
- id: ruff-format | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.10.1 | ||
hooks: | ||
- id: mypy | ||
# args: [--strict] # Put config in pyproject.toml. If it doesn't work, put it here. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Sincere Singularities | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
||
--- | ||
|
||
The Software incorporates code from <https://github.com/python-discord/code-jam-template> which is under the following license: | ||
|
||
Copyright 2021 Python Discord | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
# Restaurant Rush: Kitchen Chaos | ||
|
||
**Sincere Singularities** Python Discord Summer CodeJam 2024 project. | ||
The technology is **Discord Application**, the theme is **Information Overload**, and our chosen framework | ||
is [Disnake](https://github.com/DisnakeDev/disnake/). | ||
|
||
--- | ||
|
||
Did you ever want to experience the information overload and stress of a phone operator? | ||
Well, then you're at the right place! | ||
|
||
We've created the first stressful Discord game, in which you play a phone operator for multiple restaurants. | ||
No matter what dishes, customers, or special orders you have to serve, don't lose focus, or you might get overwhelmed by | ||
the information overload! | ||
|
||
|
||
|
||
## Getting Started | ||
See [Installation](https://github.com/SincereSingularities/SincereSingularities?tab=readme-ov-file#installation) and [Running](#running) for detailed instructions. | ||
|
||
1. Python 3.11 is [recommended](https://github.com/DisnakeDev/disnake/pull/1135#issuecomment-1847303628). Python 3.10 - 3.12 will probably work. | ||
2. Setup a [Discord Bot](https://docs.disnake.dev/en/stable/discord.html). See [Discord Bot Installation Guide](#discord-bot-installation-guide). | ||
3. Clone the repository : | ||
```shell | ||
git clone https://github.com/SincereSingularities/SincereSingularities/ | ||
cd SincereSingularities | ||
pip install -e . | ||
``` | ||
4. Setup and run [MongoDB Community Edition](https://www.mongodb.com/docs/manual/administration/install-community/) | ||
5. Set the `BOT_TOKEN`, `DB_HOST`, `DB_PORT` and `DB_NAME` environment variables using the `.env` file. | ||
6. Run The Game: | ||
```shell | ||
python -m sincere_singularities | ||
``` | ||
7. Play! | ||
|
||
## Video Presentation | ||
[Video Presentation / Description](https://streamable.com/3rcyc0) | ||
|
||
|
||
## Installation | ||
<details> | ||
<summary>Detailed Installation Guide ⚙️</summary> | ||
|
||
### 1. Requirements: | ||
1. [Python 3.11](https://www.python.org/downloads/release/python-3110/) | ||
2. [MongoDB Community Edition](https://www.mongodb.com/docs/manual/administration/install-community/). See [MongoDB Installation Guide](#mongodb-community-edition-installation-guide) | ||
3. [Discord Bot](https://docs.disnake.dev/en/stable/discord.html). See [Discord Bot SetUp Guide](#discord-bot-installation-guide) | ||
### 2. Download: | ||
Run this command in the directory you want to download it to. | ||
```shell | ||
git clone https://github.com/SincereSingularities/SincereSingularities/ | ||
cd SincereSingularities | ||
``` | ||
### 3. Install the Game as a package via pip: | ||
```shell | ||
pip install -e . | ||
``` | ||
### 4. Setup local environment values: | ||
Create and Edit an .env file (see .env.example) | ||
``` | ||
BOT_TOKEN (Your Discord Bot Token) | ||
DB_HOST (The IP address of your MongoDB Server) | ||
DB_PORT (The port of your MongoDB Server) | ||
DB_NAME (Your preferred name for the MongoDB Database, defaults to `bot_db`) | ||
``` | ||
|
||
</details> | ||
|
||
## Running | ||
<details> | ||
<summary>Detailed Running Guide ⚙️</summary> | ||
|
||
### 1. Start your [MongoDB Server](https://www.mongodb.com/docs/manual/administration/install-community/). See [MongoDB Installation Guide](#mongodb-community-edition-installation-guide) | ||
### 2. Run the Game: | ||
```shell | ||
python -m sincere_singularities | ||
``` | ||
### 3. Start a Game Session in a Text Channel: | ||
``` | ||
/start_game | ||
``` | ||
</details> | ||
|
||
## Gameplay | ||
<details> | ||
<summary>Gameplay Explanation 💡</summary> | ||
|
||
1. Choose a text channel. | ||
2. Run the `/start_game` command. That will create a thread. | ||
3. The bot will send the menu. This contains multiple restaurants that you can buy. You already own the first one. | ||
4. You will get orders in the thread as messages. Choose and enter the appropriate restaurant, and select the menu items that the customer requested. | ||
5. Then enter the customer's information which consists of: | ||
- Order ID | ||
- Customer Name | ||
- Customer Address | ||
- Delivery Time | ||
- Extra Wishes | ||
6. Submit the order. You will get points based on the accuracy of the order. With your earned coins you can buy new restaurants. | ||
7. From time to time, you will get Order Conditions. Pay attention to these Conditions when fulfilling a order. They will also disappear after some time. | ||
</details> | ||
|
||
## Helper Commands | ||
<details> | ||
<summary>Helper Commands 🔨</summary> | ||
|
||
- /clear_threads | ||
</br> | ||
``Clears the Threads in the Text Channel the Command was executed in. Requires the Author to have manage_threads permissions.`` | ||
- /clear_webhooks | ||
</br> | ||
``Clears the Webhooks in the Text Channel the Command was executed in. Requires the Author to have manage_webhooks permissions.`` | ||
</details> | ||
|
||
## Discord Bot Installation Guide | ||
<details> | ||
<summary>Discord Bot Installation Guide 🤖</summary> | ||
|
||
Extended from [Disnake Bot Guide](https://docs.disnake.dev/en/stable/discord.html) | ||
1. Create a new [Discord Application](https://discord.com/developers/applications). | ||
2. Navigate to the Bot Tab. You can customize your bot. Reset the bot token and copy the freshly created one. | ||
3. Navigate to the OAuth2 Tab. | ||
1. Under `Scopes`, check `bot` and `applications.commands`. | ||
2. Under `Bot Permissions`, check `Manage Webhooks`, `Send Messages`, `Create Public Threads`, `Send Messages in Threads`, `Manage Messages`, `Manage Threads`, | ||
3. Copy the `Generated URL` | ||
4. Paste the `Generated URL` in your browser and invite the bot to your server. | ||
</details> | ||
|
||
## MongoDB Community Edition Installation Guide | ||
<details> | ||
<summary>MongoDB Server Installation Guide 💾</summary> | ||
|
||
Extended from [MongoDB Community Edition Installer](https://www.mongodb.com/docs/manual/administration/install-community/) | ||
1. Install on Windows | ||
1. For Installation, follow [Windows Installation Guide](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-windows/#install-mongodb-community-edition) | ||
2. To Run MongoDB, follow [Windows Running Guide](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-windows/#run-mongodb-community-edition-from-the-command-interpreter) | ||
2. Install on MacOS | ||
1. For Installation, follow [MacOS Installation Guide](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/#install-mongodb-community-edition) | ||
2. To Run MongoDB, follow [MacOS Running Guide](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/#run-mongodb-community-edition) | ||
3. Install on Ubuntu | ||
1. For Installation, follow [Ubuntu Installation Guide](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/#install-mongodb-community-edition) | ||
2. To Run MongoDB, follow [Ubuntu Running Guide](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/#run-mongodb-community-edition) | ||
4. Install on Debian | ||
1. For Installation, follow [Debian Installation Guide](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-debian/#install-mongodb-community-edition) | ||
2. To Run MongoDB, follow [Debian Running Guide](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-debian/#run-mongodb-community-edition) | ||
5. Install on SUSE | ||
1. For Installation, follow [SUSE Installation Guide](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-suse/#install-mongodb-community-edition) | ||
2. To Run MongoDB, follow [SUSE Running Guide](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-suse/#run-mongodb-community-edition) | ||
|
||
</details> | ||
|
||
## Preview Images | ||
<details> | ||
<summary>Preview Images 📸</summary> | ||
|
||
#### Main Menu: | ||
<img src="https://github.com/user-attachments/assets/fbb6ae72-de95-45db-9cc3-a1c8c720d809" width="300"> | ||
|
||
#### Restaurant Menu: | ||
<img src="https://github.com/user-attachments/assets/292bf979-7644-4385-a47e-f244ff04016e" width="300"> | ||
|
||
#### Easy Order (Pizzaria): | ||
<img src="https://i.ibb.co/bvCNF5x/IMG-5599.jpg" width="300"> | ||
|
||
#### Medium Order (Fast Food): | ||
<img src="https://i.ibb.co/ZY1xh8L/IMG-5600.jpg" width="300"> | ||
|
||
#### Hard Order (Sushi): | ||
<img src="https://i.ibb.co/khxGccr/IMG-5601.jpg" width="300"> | ||
</details> | ||
|
||
# Credits | ||
This project was created by (in order of contributed LOC): | ||
|
||
| [Vinyzu](https://github.com/Vinyzu) | [koviubi1](https://github.com/koviubi56) | [WassCodeur](https://github.com/WassCodeur) | [clucker_m8](https://github.com/clucker-m8) | [FoxFil](https://github.com/foxfil) | | ||
|---------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------| | ||
| [<img src="https://github.com/vinyzu.png" alt="vinyzu" title="Vinyzu" width="66">](https://github.com/vinyzu) | [<img src="https://github.com/koviubi56.png" alt="koviubi1" title="koviubi1" width="66">](https://github.com/koviubi56) | [<img src="https://github.com/WassCodeur.png" alt="WassCodeur" title="WassCodeur" width="66">](https://github.com/WassCodeur) | [<img src="https://github.com/clucker-m8.png" alt="clucker_m8" title="clucker_m8" width="66">](https://github.com/clucker-m8) | [<img src="https://github.com/foxfil.png" alt="FoxFil" title="FoxFil" width="66">](https://github.com/foxfil) | | ||
| Game | Game | Database | Order Generation | Restaurant Menus | |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting your requirements in
additional_dependencies
will allow mypy to type check usage of imported code.Looks like it wasn't able to catch some issues in
bot.py
because it couldn't find the dependencies.https://github.com/pre-commit/mirrors-mypy?tab=readme-ov-file#using-mypy-with-pre-commit