# Installation

## Installation Guide for Unbot

Welcome to the installation guide for **Unbot**, the dedicated Discord bot for the UnInbox server. This document provides step-by-step instructions on how to set up Unbot on your machine and get it running.

### Prerequisites

Before you begin, ensure you have the following installed on your system:

* [Node.js](https://nodejs.org/) (v16.6.0 or higher)
* [Bun](https://bun.sh/) as the JavaScript runtime and package manager

### Getting Started

1. **Clone the Unbot Repository**

   First, clone the Unbot repository to your local machine using Git. Open your terminal and run the following command:

   ```bash
   git clone https://github.com/yourgithub/unbotjs.git
   cd unbotjs
   ```

2. **Installing Dependencies**

   With Bun installed, you can now install all the necessary dependencies for Unbot. ***Run the following command in the terminal within your project directory:***

   ```bash
   bun install
   ```

3. **Setting Up Environment Variables**

   Create a ***.env*** file in the root directory of your project and populate it with the necessary values:

   ```plaintext
   DISCORD_BOT_TOKEN=YOUR_BOT_TOKEN_HERE 
   SUPABASE_URL=YOUR_SUPABASE_URL 
   SUPABASE_KEY=YOUR_SUPABASE_ANON_KEY 
   OPENAI_API_KEY=YOUR_OPENAI_API_KEY
   ```

4. **Running Unbot**

   With the dependencies installed and environment variables set, you're now ready to run Unbot.&#x20;

   ```bash
   bun run unbot
   ```

5. **Registering Commands**

   Before using Unbot's commands on your server, you'll need to register them with Discord's API. You can do this by running:

   ```bash
   bun run register
   ```

### Next Steps

Congratulations! You've successfully set up Unbot on your system. Explore the bot's features, customize its functionality, and consider contributing to its development.

### Troubleshooting

{% hint style="danger" %}
*If you encounter any issues during the installation process, refer to our Troubleshooting Guide or reach out to the community for support.*
{% endhint %}
