Installation
To install the bot for self-hosting, follow these steps:
-
Clone the repository: Open your terminal and run the following command to clone the bot’s repository:
Terminal window git clone https://github.com/Arsabutispik/Khaxy.gitcd Khaxy -
Install dependencies: Run the following command to install the required dependencies:
Terminal window pnpm install# If you don't have pnpm installed, you can install it using npm:# npm install -g pnpm -
Configure environment variables: Copy the
.env.examplefile to.envand fill in the required environment variables:Terminal window cp .env.example .envOpen the
.envfile and set the following variables:TOKEN: Your Discord bot token.GUILD_ID: The ID of the Discord server for development purposes.CLIENT_ID: The ID of your Discord application.NODE_ENV: Set toproductionfor production environments ordevelopmentfor development environments.DATABASE_URL: The connection string for your PostgreSQL database.DOCS_URL: The URL for the documentation site. (Optional, defaults tohttps://docs.khaxy.com)
-
Change Configuration: Visit
config.tomlfor various configuration options.
- Set up the database:
Ensure your PostgreSQL database is running and accessible.
You can create a new database for the bot or use an existing one.
Update the
DATABASE_URLin your.envfile with the correct connection string. - Run the bot:
After configuring the environment variables, you can start the bot by running:
Terminal window pnpm deploy-commands # This deploys the slash commands to Discordpnpm start