# Bot

{% hint style="danger" %}
This documentation site is deprecated. Please visit the README of <https://github.com/synzen/MonitoRSS> for hosting instructions.
{% endhint %}

If you're using FreeBSD, more specific instructions can be found [here](https://github.com/synzen/MonitoRSS/issues/26), provided by Ultima.

If you're using Heroku, see [here](https://github.com/synzen/MonitoRSS/issues/45) (provided by [Macley-Kun](https://github.com/Macley-Kun)) or [here (more complicated, but needs no credit card)](https://github.com/synzen/MonitoRSS/issues/95) (provided by [codeinteger6](https://github.com/codeinteger6)).

#### Table of Contents

1. Requirements
2. Setup
3. Running

## Requirements

1. Node.js v12.16 to 14

## Setup

1. Install [Node.js](https://nodejs.org/en/) (must be at least v12.16).
2. Clone files from [https://github.com/synzen/MonitoRSS-Clone/](https://github.com/synzen/MonitoRSS-Clone) on the **master** branch
3. Use `npm install` in the directory from console to install all dependencies/modules. If you see any `make` errors, they can be ignored since they are optional dependencies.
4. Create and get a bot token from <https://discordapp.com/developers/applications/>.
   * "Create an Application" -> Click "Bot" on the left panel -> "Add Bot" -> Set icon and username -> "Save Changes" -> Click "Copy" under Token
5. Set the bot token and any other changes into settings/[config.bot.json](https://docs.monitorss.xyz/configuration/bot-configuration). You may copy the example json file in the settings folder, and rename it to config.bot.json
6. Click "OAuth2" on the left panel, then check the "bot" scope and whatever other permissions at the bottom. Use the generated invite URL to invite the bot.&#x20;
7. Configure whether the bot should use a MongoDB database. See [here](https://github.com/synzen/Discord.RSS/wiki/MongoDB-vs-Databaseless) for the difference.
   * **MongoDB** - Recommended (*only 64-bit systems are supported*). Follow below instructions is running it locally.
     * Install [MongoDB](https://www.mongodb.com/download-center/community) (v4.2+).
     * Start the DB server in console by `mongod`, or automatically on bootup (ubuntu/debian `sudo systemctl enable mongod.service`). It must be constantly running in the background.
   * **Databaseless** (if MongoDB is not possible)
     * Set the [config.bot.json](https://docs.monitorss.xyz/configuration/bot-configuration#bot) value of `database.uri` to a folder path where guild profiles will be stored.
8. If you intend to use Discord commands, you *must* enable Message Content Intent in Discord's control panel for your bot application. This is required for the beat to read and respond to Discord messages. See the image below.<br>

   <figure><img src="/files/WanecofbLcDybUN0Uoz5" alt=""><figcaption><p>Enable message content intent</p></figcaption></figure>

#### Sharding

Sharding is default behavior. If you want to explicitly define the number of shards, set `config.advanced.shards`.

{% hint style="danger" %}

## **Security Notice**

Do not *ever* post your bot token (or files containing your bot token) anywhere where anyone else can see or access it. With the token, your bot app can be accessed by anyone and might cause your account to be banned on behalf of someone else's actions.

I am not responsible for what happens if someone gets a hold of the token that happens to be the same one you use to run this bot.
{% endhint %}

## Running

Run `node bot.js` or `nodejs bot.js`.&#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://docs.monitorss.xyz/setting-up/bot.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.
