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/assetsstores static assets. - the
/bot/cogsstores the bot logic. - the
/bot/datastores script to initialize PostgresSQL database. - the
/bot/modulestores our self-made python modules.
- the
Prerequisites:
- UV (https://docs.astral.sh/uv/)
- 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_TOKENin the.envfile. - You can use our provided
.env.examplein the root directory, just rename it to.env. - Install dependencies using
uv sync. - Next we will create our database by executing the
db.sqlscript in thebot/data(run this either using pgAdmin or psql). - Ensure to set the
BOT_DEBUG=1in the.envfile for debugging mode. Set toBOT_DEBUG=0for Production only. - Start the bot by running
uv run task start.
- Got Invalid literal for int() with base 10: 'YOUR_GUILD_ID' after running
uv run task start- Define the
GUILD_IDvalue in.envfile 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 and type check first to make sure your code follow our rules by:
- Running
uv run task check.
or running each command manually:
- Running
formatby executinguv run ruff format. - Running
lintingby executinguv run ruff check. - Running
type checkby executinguv run pyright.
As we want to have standardize commit messages, please follow this commit message convention guide and 50/72 commit message rule format.