# Installation

{% hint style="danger" %}
**Cosmo has been discontinued. Support will not be given.** This documentation is only here if you wish to continue using Cosmo and for the sake of internet history.
{% endhint %}

## Prerequisites

* A web server (VPS, dedicated, etc.) that you can deploy Cosmo on.
  * Python 3.11.
  * Port 80 (HTTP) or 443 (HTTPS) open. The web server must run on the default port.
  * At least 100MB of RAM is recommended.
* Some Cosmetics to import into the bot. Some are provided, but it is recommended that you make your own.

## Creating the Discord Bot

* Go to [Discord's Developer Portal](https://discord.com/developers/applications).
* Create a new application. Set the username and, optionally, the profile picture.
* On the left menu, click Bot.
* Click "Create a Bo&#x74;**"** and set its username and, optionally, the profile picture (if the bot has not been created automatically already).
* Untick "Public Bot" so other people can't just invite your bot onto their server.
* Enable the "Message Content" & "Server Member&#x73;**"** intent. You may have to scroll down to find these.
* Click Copy Token. Keep this safe, ready to paste into the `settings.yml` file.
* Go to OAuth, then URL generator. For scope, select "bot" and "application.commands". For permission, tick either Administrator or all the permissions the bot needs (view channel, send messages, embed links, use external emojis...).
* Go to the generated link and follow the instructions to add the bot to the server of your choice.

## Deploying

* You will need to run your Python file as a Flask app. There are many [tutorials](https://www.youtube.com/results?search_query=how+to+run+a+flask+app) online that show how you can host this. You should NOT use Pterodactyl as you cannot use port **80** or **443**, which Cosmo requires.
* Copy the contents of the folder "bot-and-server" and copy it into your host.
* Edit the `settings.yml` file to your choosing, make sure to get your license key from the Support Server and fill in your Discord Bot token.
* Edit the `commands.yml` file if you wish to disable commands, change descriptions or set if the response should be hidden.
* Install the dependencies with the command: `python3.11 -3 -m pip install -U -r requirements.txt`.
* Start the bot with: `python3.11 main.pyc` (The Python version may change depending on your version).
* Go to Server Settings -> Integrations in your Discord Server and click on your bot.
* For each slash command, assign role and user overrides that determine who can use the slash command. By default, only users with Administrator permissions can execute admin commands, and all users can use the user commands.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cosmo.atomatrix.gg/web-server-and-discord-bot/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
