Skip to content

Commit

Permalink
updating contribution
Browse files Browse the repository at this point in the history
  • Loading branch information
sarzz2 committed Nov 9, 2023
1 parent 87e7984 commit 50f78ec
Showing 1 changed file with 44 additions and 26 deletions.
70 changes: 44 additions & 26 deletions CONTRIBUTING.md
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.

0 comments on commit 50f78ec

Please sign in to comment.