Skip to content

Installing Leveler

Fixator10 edited this page Jun 22, 2022 · 16 revisions

Installation of MongoDB

For Leveler, you will need MongoDB.

Selfhosted

To install MongoDB for your OS, please refer to one of next manuals:

Note: Red had its own MongoDB config driver. Leveler is not related to this config driver, and works directly with MongoDB.

Alternative: MongoDB Cloud

Alternatively, you can get hosted instance of MongoDB on MongoDB Cloud.

To use MongoDB Cloud: [p] is your prefix

  1. Use command [p]pipinstall dnspython to install dependency that required for MongoDB cloud URLs connection.
  2. Restart your bot.
  3. Get your URL:
    1. Press "Connect" on your created Cluster.
    2. Setup connection security, if you have not done this yet
    3. On "Choose a connection method" select "Connect with the mongo shell".
    4. Copy your URL from Use this connection string in your application: field
      1. You need only proto:// & domain.tld, e.g.: mongodb+srv://cluster42.red13.mongodb.net
  4. Use URL you copied as host setting: [p]levelerset host mongodb+srv://cluster42.red13.mongodb.net
    1. Don't forget to setup your credentials via [p]levelerset credentials <login> <password>

SciPy

SciPy lib is used for auto-color feature, which allows set colors for elements of ranks/profile/etc images based on background images.

This is not required, but to use auto-color feature, you need to install scipy.

  1. Activate your bot's venv win | linux
  2. Install SciPy: python -m pip install -U numpy scipy
  3. Restart your bot

Installing Leveler

Now, we are ready to install Leveler itself.

[p] is your prefix

  1. Load Red's "downloader" cog with [p]load downloader, if you haven't loaded it yet.
  2. Use command [p]repo add Fixator10-Cogs https://github.com/fixator10/Fixator10-Cogs V3
  3. Wait for download
  4. Use command [p]cog install Fixator10-Cogs leveler
  5. Wait for installation
  6. Use command [p]load leveler
  7. The cog now should be loaded, you can test it and see commands via [p]help Levelercase-sensitive

Troubleshooting

My bot throws error on load, something related to pillow

Seems like you have corrupted or incorrect pillow installation

  1. Shutdown your bot
  2. Activate your bot's venv win | linux
  3. Run the following commands in order, one after another:
    1. pip uninstall pillow
    2. pip uninstall PIL
    3. pip install --force-reinstall --no-cache-dir wheel setuptools
    4. pip install --force-reinstall --no-cache-dir pillow
  4. Start your bot