# Welcome

![](https://1956695572-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUcrqIZouK-K4zsrp7N%2F-MUcyHdiiXMVr-dGBa3q%2F-MUcyq6Ylo7lmutNzDAR%2Fzeobot%20\(1\).png?alt=media\&token=6f4a8cbf-9283-4ccd-91f4-89ccf4917d30)

Welcome to ZeoBot's documentation. The purpose of this wiki is to guide you with setting up the bot, using it and upgrading to future versions. Still unsure? Join our [Discord](https://discord.gg/c4aKrWf3bv) and talk to our friendly support team.

### About ZeoBot

ZeoBot is a multipurpose Discord bot featuring all of the modules your server will love including moderation, tickets, XP, anti-raid tools, music and giveaways, for the cheapest price possible. Not conviced? Check out the full list of features on our BuiltByBit page.

ZeoBot is very developer-friendly, with a custom addon-manager, developers, including yourself, can code custom features and specify your own dependencies using the advanced addon-manager.

ZeoBot is highly customisable, featuring complete embed and command editing, allowing you to configure ZeoBot to match your style or even translate it into a different language. Configure settings, permissions, commands, embeds and more in the detailed configuration files. <br>


# 1. Create your Discord Bot

1. Go to [https://discord.com/developers](https://discord.com/developers/applications) and press "New Application".
2. Name the application and optionally upload an avatar for the bot.
3. Go to the **bot** tab, press the "add bot" button and confirm creating the bot.
4. While still in the **bot** tab, scroll down to **Privileged Gateway Intents** and enable the server members, presence and message content intents.
5. Click the **OAuth2** tab. Select the **bot** scope from the list, then select **administrator** from the permissions list. Finally, copy the invite link.
6. Paste the invite link from the previous step into a new tab to invite your bot. Select the server you want to add the bot to and click **authorise**.

{% hint style="warning" %}
Ensure that you disable **public bot** or anyone can add the bot to their server.
{% endhint %}

{% hint style="danger" %}
Ensure you enable all **privileged gateway intents** or the bot will not work.
{% endhint %}


# 2. Download and Setup

## Download ZeoBot

1. Visit our [BuiltByBit](https://builtbybit.com/resources/18768/) page and press **download**. You must be logged in with the account you purchased ZeoBot on.
2. Navigate to your **downloads** folder and unzip the bot archive.
3. Open `settings.yml` and insert your **bot token** and your **license key** into `bot_token` and `license` respectively.&#x20;

{% hint style="info" %}
Join our [Discord server](https://discord.gg/c4aKrWf3bv) to obtain your license key.
{% endhint %}

## Configure ZeoBot

Use the detailed configuration files to configure the bot to fit your needs. Follow the guidance of the comments to help you configure the bot, however if you need any further assistance, do not hesitate to join our [Discord server](https://discord.gg/c4aKrWf3bv) for help.

You can configure settings in `settings.yml`, permissions in `permissions.yml` and commands in `commands.yml`. You can also configure embeds in `embeds.yml` and components in `components.yml`.&#x20;

{% hint style="warning" %}
Ensure all the channels and roles you configure in `settings.yml` and `permissions.yml` exist on you server.
{% endhint %}


# 3. Start your Bot

## System Wide Dependencies

ZeoBot requires a few additional pieces of software to run. Any platforms that require additional configuration will be listed below:&#x20;

* [Python 3.10 ](https://www.python.org/downloads/)
* Java 11 JRE (This is usually installed for you, however it is a good idea to have it installed in case your system does not support the version of Java automatically installed)
* Git

#### System Requirements

* `512 MB` of RAM
* At least 500MB of storage space
* An internet connection
* Some form of text editor

{% hint style="info" %}
ZeoBot should automatically install its packages when you run it. This may take some time depending on the hardware specification of your computer.
{% endhint %}

## Windows

1. Install [Git](https://gitforwindows.org). Git is required in order to resolve and download dependencies. To test your installation, try running `git` on the command line.
2. Ensure you have [Python 3.10 ](https://www.python.org/downloads/)installed and that it is the default version. To test,  run `py -V`on the command line. If it reports that the Python version is at least 3.10, you are good to go.

&#x20;   4\. Open a command prompt in the folder that ZeoBot is located in and run `py -3.10 main.py`.

## Linux

1. Install Python 3.10 as the system default. Most Linux distros ship with a different version of Python, so ensure `python3 -V` displays Python 3.10 as the version.

&#x20; 2\. Install the following packages with your package manager, for example `apt`. You will most likely have some already installed.\
**`make ca-certificates build-essential git tar sqlite fontconfig tzdata python3.10-dev gcc g++ libffi-dev`**

&#x20; 3\. Change directory to the folder that ZeoBot is located in and run `python3 main.py`. You can additionally use `screen python3 main.py` to run the bot in the background via screen.

{% hint style="info" %}
On non-Debian based systems, some packages are named different.
{% endhint %}

{% hint style="warning" %}
On some Linux distributions, you may have to compile Python 3.10 from source. In this case, you will additionally need to install some additional packages:`zlib1g-dev libffi-dev python3-dev lzma-dev libssl-dev liblzma-dev libsqlite3-dev`
{% endhint %}

## macOS

1. Install [Python 3.10](https://www.python.org/downloads/) and ensure that it is the system default. Use `python3 -V` and make sure it displays Python 3.10 as the version.
2. Install macOS Command Line Tools by opening a terminal and entering `xcode-select --install`.
3. Open a terminal, change directory to the folder that ZeoBot is located in and run `python3 main.py`.

{% hint style="info" %}
If you encounter a security block when running the bot, run this command from the installation folder: `xattr -d com.apple.quarantine core/startup/*.so`
{% endhint %}

## Pterodactyl

Pterodactyl's TMPFS size has to be expanded. Most hosts automatically do this, however you may need to expand it if you run your own Pterodactyl instance.&#x20;

1. Open your Pterodactyl `config.yml` file, usually located at `/etc/pterodactyl/config.yml` with a text editor.
2. Find the line `tmpfs_size` and set it to `tmpfs_size: 1000`.
3. Save your changes and restart `wings`.

You will also need to change your music port depending on the port allocated to you. To find this, click `Network` at the top of the server page and look for the value above `Port`. Open ZeoBot's `settings.yml` file and find the `port` option under `music_server`. Replace the default value with the allocated port and save your changes.&#x20;

{% hint style="warning" %}
There is an issue in Pterodactyl that causes the bot to be killed when you press the stop button. Instead stop the bot by entering `stop` in the console.
{% endhint %}

{% hint style="danger" %}
If you are still experiencing issues on Pterodactyl, make sure you are using the official Discord.py egg. Some third-party eggs do not install the required system packages.
{% endhint %}


# Addon Installation

Install addons to expand ZeoBot's functionality.

### Download the Addon

Join our [Discord server](https://discord.gg/c4aKrWf3bv), open a ticket for the customer role and navigate to the addons channel. In the addons channel you can find addons made by us and other approved Community Developers. Click the download link of the addon you want to install and you should be taken to its BuiltByBit page.

### Unzip and Install the Addon

After downloading the addon .zip, unzip the file and move the resulting folder to ZeoBot's `addons` folder.

### Configure the Addon

Some addons will need additional configuration. Check for any configuration files in the addon's folder and configure them to your liking. You must restart the bot for addons to be loaded.

{% hint style="warning" %}
If the addon is made by a Community Developer, you will need to contact them for support.
{% endhint %}

{% hint style="danger" %}
Do not install any ZeoBot addons that are not from us or a Community Developer as they may break the bot and potentially damage your system.
{% endhint %}


# 2.0.0 Upgrade Guide

v 1.1.4 -> 2.0.0 Upgrade Guide

### Backup Configuration

Copy your settings.yml, permissions.yml, aliases.yml and errors.json to a safe place to help you configure the bot later, or in case you wish to downgrade.

### Backup Databases

If you are using SQLite for storage, copy your `database` folder to a safe place for migration after you upgrade.

### Update Python

Update your Python version to 3.9 (<https://www.python.org/downloads/>) and ensure it is set as the system default. Use `python3 -V` to test on Linux and macOS or `py -V` on Windows and ensure it displays 3.9 as the version.

### Update ZeoBot

After you have backed up your configuration files and databases, you will need to completely re-install ZeoBot as this is a significant upgrade. Download the latest release from MC-Market, and unzip it to a different folder. Make sure there are no traces of the old version in this folder.

### Migrate Databases

If you are using SQLite, make sure the database type is set to SQLite in the configuration. Create a folder in the ZeoBot folder called `database`. Paste all your database files here.\
If you are using PostgreSQL, make sure your database details are filled in the configuration.&#x20;

Now, open the `migration` folder, then open the `2.0.0` folder and run the `migrate_databases.py` file. (`python3 migrate_databases.py` for macOS and Linux or `py -3.9 migrate_databases.py` for Windows).&#x20;

### Configure and Run ZeoBot

After your databases have been migrated, configure ZeoBot's new configuration files, using the old files as a guide. Finally, run ZeoBot in the same way as before, following the [Dependencies](/installation/3.-dependencies) guide.&#x20;

{% hint style="info" %}
Make sure you run the migration script from the `2.0.0` folder.
{% endhint %}

{% hint style="danger" %}
If database migration fails, you will have to delete the databases in the case of SQLite or reset the database in the case of PostgreSQL.
{% endhint %}


# 2.0.1 Upgrade Guide

v 2.0.0 -> 2.0.1 Upgrade Guide

The 2.0.1 is a small bugfix update that is easy to upgrade to.&#x20;

Simply download the latest version from MC-Market. Extract the zip and find the `cogs` folder. Replace the existing `cogs` folder with the new one and restart the bot.


# 2.1.0 Upgrade Guide

v 2.0.1 -> 2.1.0 Upgrade Guide

### Backup Configuration

Copy all of your configuration (settings.yml, permissions.yml, aliases.yml, embeds.yml and errors.json) to a safe place to help you configure the bot later, or in case you wish to downgrade. Do not copy application.yml. Additionally, you should backup the `filter.txt` file in the cogs > admin folder to save your blacklisted words.

### Backup Databases

If you are using SQLite for storage, copy your `database` folder to a safe place to restore after installing the new version.

### (Optional) Update Python

If you are migrating from ZeoBot 2.0.1, you should already have some version of Python 3.9 installed. It is recommended to update to the latest patch version - at the time of writing this is Python 3.9.5. - for bug fixes and optimisations. This is not required however.&#x20;

### Update ZeoBot

After you have backed up your configuration files and databases, you will need to completely re-install ZeoBot as there are configuration and structure changes. Download the latest release from MC-Market and unzip it to a different folder. Make sure there are no traces of the old version in this folder.

### Restore Databases

If you are using SQLite, paste your old `database` folder into the new installation (there are no database changes). If you are using PostgreSQL or MySQL, you do not need to do anything except fill in your database details.

### Configure and Run ZeoBot

After your databases have been restored, configure ZeoBot's new configuration files, using the old files as a guide. There are changes to configuration in all configuration files so do not use your old configuration files directly .Using a diff tool such as [diffchecker](https://www.diffchecker.com) is recommended to find changes. You can directly paste your `filter.txt` file into the cogs > admin folder however. Finally, run ZeoBot in the same way as before, following the [Dependencies](/installation/3.-dependencies) guide.&#x20;


# 2.2.0 Upgrade Guide

v 2.1.0 -> 2.2.0 Upgrade Guide

### Backup Configuration

Copy all of your configuration (settings.yml, permissions.yml, aliases.yml, embeds.yml and errors.json) to a safe place to help you configure the bot later, or in case you wish to downgrade. Do not copy application.yml. Additionally, you should backup the `filter.txt` file in the cogs > admin folder to save your blacklisted words.

### Backup Databases

If you are using SQLite for storage, copy your `database` folder to a safe place to restore after installing the new version.

### Update ZeoBot

After you have backed up your configuration files and databases, you will need to re-install ZeoBot as there are configuration and structure changes. Download the latest release from MC-Market and unzip it to a different folder. Make sure there are no traces of the old version in this folder.

### Migrate Databases

If you are using SQLite, make sure the database type is set to SQLite in the configuration. Create a folder in the ZeoBot folder called `database`. Paste all your database files here.\
If you are using PostgreSQL or MySQL, make sure your database details are filled in the configuration.&#x20;

Now, open the `migration` folder, then open the `2.2.0` folder and run the `migrate_databases.py` file. (`python3 migrate_databases.py` for macOS and Linux or `py -3.9 migrate_databases.py` for Windows).&#x20;

### Configure and Run ZeoBot

After your databases have been migrated, configure ZeoBot's new configuration files, using the old files as a guide. There are changes to configuration in all configuration files so do not use your old configuration files directly. Using a diff tool such as [diffchecker](https://www.diffchecker.com) is recommended to find changes. You can directly paste your `filter.txt` file into the cogs > admin folder however. Finally, run ZeoBot in the same way as before, following the [Dependencies](/installation/3.-dependencies) guide.&#x20;

{% hint style="info" %}
Make sure you run the migration script from the `2.2.0` folder. Do not use the `2.0.0` scripts.
{% endhint %}

{% hint style="danger" %}
If database migration fails, you will have to delete the databases in the case of SQLite or reset the database in the case of PostgreSQL or MySQL.
{% endhint %}


# 2.2.1 Upgrade Guide

v 2.2.0 -> 2.2.1 Upgrade Guide

The 2.2.1 release is a small bug-fix update which is easy to upgrade to.&#x20;

Simply download the latest version from MC-Market. Extract the zip and copy over the `main.py` and `classes.py` files to your existing installation, replacing the old files.&#x20;

You should also copy over the `igversion.py` file from the `cogs/startup` folder into the same folder of your existing installation.&#x20;


# 3.0.0 Upgrade Guide

v 2.1.1 -> 3.0.0 Upgrade Guide

### Backup Configuration

Copy your settings.yml, permissions.yml, aliases.yml and errors.json to a safe place to help you configure the bot later, or in case you wish to downgrade.

### Backup Databases

If you are using SQLite for storage, copy your `database` folder to a safe place for migration after you upgrade. If using PostgreSQL/MySQL, you should create a database dump.

### Update Python

Update your Python version to 3.10 (<https://www.python.org/downloads/>). Use `python3 -V` to test on Linux and macOS or `py -V` on Windows and ensure it displays 3.10 as the version.

### Update ZeoBot

After you have backed up your configuration files and databases, you will need to completely re-install ZeoBot as this is a complete rewrite. Download the latest release from BuiltByBit, and unzip it to a different folder. Make sure there are no traces of the old version in this folder.

### Migrate Databases

Download the database migration tool from [here](https://cdn.zingyawesome.com/go/s4xHp) and unarchive it.

After unarchiving the file, open the `db.yml` file. If you are using SQLite, set the `database_type` to `sqlite` and paste all your database files into the `database` folder.\
If you are using PostgreSQL/MySQL, set the `database_type` accordingly and enter your database details.

Now run the `migrate.py` file. (`python3 migrate.py` for macOS and Linux or `py -3.10 migrate.py` for Windows).&#x20;

{% hint style="warning" %}
Make sure you have a backup of your databases before migration!
{% endhint %}

{% hint style="danger" %}
If database migration fails, you will have to delete the databases in the case of SQLite or reset the database in the case of PostgreSQL/MySQL.
{% endhint %}

### Configure and Run ZeoBot

After your databases have been migrated, configure ZeoBot's new configuration files, using the old files as a guide. Finally, run ZeoBot in the same way as before, following the [start guide](/installation/3.-dependencies).&#x20;


# 3.0.1 Upgrade Guide

v 3.0.0 -> 3.0.1 Upgrade Guide

The 3.0.1 release is a small bug-fix update which is easy to upgrade to.&#x20;

Simply download the latest version from BuiltByBit. Extract the zip and copy over the following files to your existing installation, replacing the old files:&#x20;

* pyproject.toml
* core/addon\_loader.py
* core/bot\_base.py
* core/config.py


# 3.0.2 Upgrade Guide

v 3.0.1 -> 3.0.2 Upgrade Guide

The 3.0.2 release is a small update which is easy to upgrade to.&#x20;

Simply download the latest version from BuiltByBit. Extract the zip and copy over the following files to your existing installation, replacing the old files:&#x20;

* pyproject.toml
* embeds.yml
* settings.yml
* cogs/moderation/message\_logger.py
* cogs/music/player.py
* cogs/tickets/close.py
* cogs/tickets/utils.py

### Configuration Changes

Instead of replacing settings.yml, you can perform the following changes on settings.yml:

* Remove `hasteserver` and `hasteserver_timeformat` from the bottom

Instead of replacing embeds.yml, you can perform the following changes on embeds.yml:

* Remove `message_delete_hastebin_title`, `message_delete_hastebin_description` and `message_delete_hastebin_attachment`
* Remove `message_edit_hastebin_title`, `message_edit_hastebin_description` and `message_edit_hastebin_attachment`&#x20;
* Change `message_longdelete_log` to

  ```yaml
  # Additional %author%, %author-mention%, %author-id%, %author-avatar%, %deleter%, %deleter-mention%, %deleter-id%, %channel-name%, %channel-mention% and %deleted-after% placeholders available
  message_longdelete_log:
    title: "🗑️ Message Deleted"
    fields:
      - ["Author: ", "%author-mention% \n", false]
      # Deleted by field will not be added if the user deleted their own message
      - deletedby: ["Deleted By: ", "%deleter-mention% \n", false]
      - ["Channel: ", "%channel-mention% \n", false]
      - ["Deleted After: ", "%deleted-after% \n", false]
    thumbnail: "%author-avatar%"
    colour: "normal"
  ```
* Change `message_longedit_log` to

  ```yaml
  # Additional %author%, %author-mention%, %author-id%, %author-avatar%, %channel-name%, %channel-mention% and %edited-after% placeholders available
  message_longedit_log:
    title: "📝 Message Edited"
    description: "[Go to message](%message-url%)"
    fields:
      - ["Author: ", "%author-mention% \n", false]
      - ["Channel: ", "%channel-mention% \n", false]
      - ["Edited After: ", "%edited-after%", false]
    thumbnail: "%author-avatar%"
    colour: "normal"
  ```


# 3.0.3 Upgrade Guide

v 3.0.2 -> 3.0.3 Upgrade Guide

The 3.0.3 release is a small bug-fix update which is easy to upgrade to.&#x20;

Simply download the latest version from BuiltByBit. Extract the zip and copy over the following files to your existing installation, replacing the old files:&#x20;

* pyproject.toml
* core/embed\_loader.py
* cogs/admin/message.py
* cogs/moderation/punishments.py


