Skip to content

Installation

By Devvyyxyz

This guide covers the installation and setup of Xeno Bot, including dependency installation and environment preparation. Follow the steps below to get started.


Prerequisites

Before installing Xeno Bot, confirm that your system meets the following requirements:

System Requirements

  • Operating System: Windows, macOS, or Linux
  • Node.js: Version 18 or later
    !!! warning Ensure you have Node.js installed. Older versions may not support the latest discord.js features.
    Download Node.js here.
  • npm: Comes bundled with Node.js
  • Git: Required for cloning the repository.
    Download Git here.

Optional:

  • SQLite or Postgres: SQLite is used by default for smaller setups. For larger deployments, install PostgreSQL.

Step 1: Clone the Repository

Open a terminal and run the following:

git clone https://github.com/devvyyxyz/xeno-bot.git
cd xeno-bot

Note

Cloning the repository ensures you’re working with the latest stable Xeno Bot version. Keep your local copy updated by pulling new changes as needed.


Step 2: Install Dependencies

Install the required dependencies by running:

npm install

This will set up everything listed in the package.json file.

Tip

If you encounter errors during installation, make sure your Node.js version meets the requirements and your internet connection is stable. Use npm install --legacy-peer-deps if dependency conflicts occur.


Step 3: Set Up the Environment

Create a .env File

Copy the template environment file:

cp .env.example .env

Edit the .env file to include your bot token and other essential values. Example:

TOKEN=your-bot-token
CLIENT_ID=your-client-id
GUILD_ID=123456789012345678 # Optional for development
LOG_LEVEL=info

Warning

Never share your .env file or commit it to version control! Use .gitignore to ensure it stays local.


Step 4: Verify Configuration Files

Xeno Bot requires configuration files in config/. Verify that the following files exist: - config/config.json: General bot settings (e.g., prefix, owner). Example:

{
  "prefix": "!",
  "owner": "YOUR_USER_ID"
}
- config/bot.public.json: Public bot metadata. - config/bot.dev.json: Development-specific settings.

Note

For detailed configuration steps, see the Configuration Guide.


Step 5: Run the Bot

Start the bot to ensure everything works as expected.

Development Mode

Run the bot locally for development:

npm run start:dev

Production Mode

Run the bot for public hosting:

npm start

Note

Use LOG_LEVEL=debug in the .env file during development for detailed logging.


Troubleshooting Installation Issues

Here are some common issues and solutions if you encounter problems during installation:

Issue: "Command Not Found"

Solution: Make sure npm and git are added to your system’s PATH. Reinstall from Node.js or Git as needed.

Issue: Dependency Errors

Solution: Use the following commands:

npm install --force
npm install --legacy-peer-deps

Issue: Missing .env Variables

Solution: Double-check that the .env file exists and is properly configured. Refer to the Configuration Guide for details.

Tip

For more issues, visit the Deployment Guide or join our community for assistance.


Optional Step: Testing with Docker

Xeno Bot also supports Docker for simplified setup in containerized environments.

Docker Quick Start

  1. Build the Docker image:
    docker build -t xeno-bot .
    
  2. Run the container:
    docker run -d --name xeno-bot xeno-bot
    

Docker-Compose Example

Alternatively, use docker-compose for easier management:

version: "3.9"
services:
  xeno-bot:
    build:
      context: .
    env_file:
      - .env
    ports:
      - "3000:3000"
    restart: unless-stopped

Tip

For more advanced deployments, see the Deployment Guide.


Example Commands

Here are useful commands you may need during installation or development:

Start the Bot

npm start

Run with Debug Logs

LOG_LEVEL=debug npm start

Deploy Slash Commands

npm run deploy-commands


With this guide, Xeno Bot should now be installed and ready for development or deployment. If you encounter any issues, refer to the troubleshooting section or reach out to the community. ```


Features of this Page:

  1. Refined Structure: Includes prerequisites, step-by-step instructions, and troubleshooting tips.
  2. Use of MkDocs Material Notes: Added !!! note, !!! tip, and !!! warning to highlight critical details.
  3. Links to Relevant Pages: Links to the Configuration and Deployment guides for seamless navigation.
  4. Docker Option: An optional testing section for users familiar with Docker.
  5. Common Commands: Added a quick reference for useful commands.

This installation page ensures everything is explained clearly for both novice and experienced users. Let me know if you require further changes or additions!