-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
26 deletions.
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 |
---|---|---|
@@ -1,48 +1,66 @@ | ||
|
||
--- | ||
|
||
# Contributing | ||
|
||
## Setup Discord application | ||
Create a new Discord application [here](https://discord.com/developers/applications) by clicking the `New application` button and name it whatever you want. | ||
## Setup Discord Application | ||
|
||
![New application](https://cdn.discordapp.com/attachments/721750194797936823/794646477505822730/unknown.png) | ||
Refer to the official discord.py [documentation](https://discordpy.readthedocs.io/en/stable/discord.html) to create a bot. | ||
|
||
Go to the Bot section on the right-hand side and click on Add Bot. | ||
## Project Setup & Installation | ||
|
||
![Add Bot](https://cdn.discordapp.com/attachments/852867509765799956/853984486970359838/unknown.png) | ||
1. Fork the repository to your own profile. | ||
2. Set up a local PostgreSQL database or use [Docker](#Docker-Setup). | ||
|
||
Copy the bot token (to be used in .env file when setting up project) | ||
```postgresql://username:password@localhost/db_name``` | ||
|
||
![Token](https://cdn.discordapp.com/attachments/852867509765799956/853985222127124500/unknown.png) | ||
Replace username, password, db_name with appropriate values. | ||
|
||
3. Run migrations. | ||
|
||
To Invite the bot to your server go to Oauth2 select bot then select administrator and go to the link | ||
![Invite Bot](https://cdn.discordapp.com/attachments/852867509765799956/853985694183850004/unknown.png) | ||
```python cli.py migrate up``` | ||
|
||
4. To install packages, run: | ||
|
||
## Project Setup & Installation | ||
```bash | ||
pip install poetry | ||
poetry install | ||
``` | ||
|
||
5. Create a .env file and copy the contents of example.env, setting up the environment variables. | ||
|
||
6. Once the above steps are done, run the bot using the command: | ||
|
||
```bash | ||
python cli.py | ||
``` | ||
|
||
1. Fork the repository to your own profile. | ||
2. Setup postgresql DB | ||
```postgresql://username:password@localhost/db_name``` | ||
Replace username, password, db_name with appropriate values | ||
3. Run migrations | ||
```python cli.py migrate up``` | ||
4. To install packages run:- | ||
|
||
```pip install poetry``` | ||
```poetry install``` | ||
5. Create a .env file and copy the contents of example.env, setup the env vars. | ||
|
||
6. Once above steps are done, run the bot using command | ||
```python cli.py``` | ||
7. Feel free to join the server in case of any issues. | ||
|
||
## Guidelines | ||
## Docker-Setup | ||
|
||
Please keep the following guidelines in mind when contributing: | ||
1. Ensure you have Docker installed and set up on your system. Refer to the [Docker's official guide](https://docs.docker.com/get-started/overview/) if needed. | ||
2. To run a PostgreSQL instance, execute: | ||
|
||
```bash | ||
docker compose up -d postgres | ||
``` | ||
The `-d` flag runs the instance in detached mode. | ||
|
||
3. Run migrations. | ||
|
||
```python cli.py migrate up``` | ||
# Guidelines | ||
|
||
Please adhere to the following guidelines when contributing: | ||
|
||
- Follow the coding style and conventions used in the project. | ||
- Write clear and concise commit messages. | ||
- Test your changes thoroughly before submitting a pull request. | ||
- Be respectful and constructive in all interactions with other contributors. | ||
|
||
## Code Quality and Testing | ||
|
||
- Ensure your code follows best practices and is well-documented. | ||
- Write unit tests for new features and ensure existing tests pass. | ||
- Perform code reviews and address feedback from other contributors. |