Welcome to the warnet-gi/WarnetBot 👋
Thanks for helping out the community!
Before creating your pull request, make sure you already read the whole guideline. If you feel that this guideline is not clear enough or have any doubts, feel free to raise it in the issue or by joining our Discord channel.
- All bot contents are stored in
/bot
.- the
/bot/assets
stores static assets. - the
/bot/cogs
stores the bot logic. - the
/bot/data
stores script to initialize PostgresSQL database. - the
/bot/module
stores our self-made python modules.
- the
Prerequisites:
- Python v3.10 (exact version)
- PostgreSQL
Steps:
- Fork or clone this repository.
- Go to Discord developers section and create a New Application.
- After creating a new app, you will be redirected to the app dashboard. Go to Bot menu in the sidebar.
- Find the Token section, then create a token.
- Copy the generated token and copy paste it to
BOT_TOKEN
in the.env
file. - You can use our provided
.env.example
in the root directory, just rename it to.env
. - Create a python virtual environment by running
python -m venv env
in the terminal to our project directory (there will be aenv/
folder in the root directory). - Execute this command to activate virtual environment:
- Linux and macOS:
source env/bin/activate
- Windows:
env/Script/Activate.bat
- Install
poetry
in the virtual environment by runningpip install poetry
. - Install dependencies using
poetry install
. - Next we will create our database by executing the
db.sql
script in thebot/data
(run this either using pgAdmin or psql). - Ensure to set the
BOT_DEBUG=1
in the.env
file for debugging mode. Set toBOT_DEBUG=0
for Production only. - Start the bot by running
poetry run task start
.
- Got Invalid literal for int() with base 10: 'YOUR_GUILD_ID' after running
poetry run task start
- Define the
GUILD_ID
value in.env
file with your Discord Server ID.
- Define the
Before sending a pull request, ensure to stage all the commit inside a new branch. Adding a prefix in your branch name will help us to recognize your pull request earlier (e.g. fix/general-welcome-message
or feat/delete-server-command
).
Run the linting first to make sure your code follow our rules by:
- Running
black
by executingpoetry run black <file or dir target>
. - Running
isort
by executingisort <file or dir target>
.
As we want to have standardize commit messages, please follow this commit message convention guide and 50/72 commit message rule format.