Skip to content

Selfhosting

Create a Discord bot here.

And an Last.FM API account.

Installing the database

  1. Download PostgreSQL 12 and start the installation.
  2. Make sure pgadmin is checked in the installation wizard.
  3. Use as password 'password'. This is safe because the database will not be accessed externally. You can set a different password in the config.json we create later.
  4. Set the port to port '5433' and continue with the installation. You can also change this port in the config if you want.
  5. After the installation is done, open pgadmin.
  6. Right-click on databases and create a database called 'fmbot'.

Running the bot

  1. Download the BinaryFiles.zip and the BinaryRelease.zip from the latest release.
  2. Extract both BinaryRelease.zip and BinaryFiles.zip and put the files into the same folder.
  3. Make sure you have the .NET Core 3.1 SDK installed
  4. Run the bot once and a config file should be created in configs/configs.json. The database tables will also be created.
  5. Open this config and enter the values. Spotify and Genius api keys aren't required, but the commands will not work.
  6. Make sure the config is in a valid json format.
  7. Run the bot again.

Updates

If you want to update the bot in the future, just download the new "BinaryRelease.zip" and/or the new "BinaryFiles.zip" and override the old files with the new ones.

Viewing the data

To view the data in the database, click the fmbot database > schemas > public > tables.

Note

Please also launch the bot from the "StartFMBot.bat" as it allows the bot to restart itself when there is an error.

Getting API keys

Discord

  1. Go to the Discord Developers Portal
  2. Create a bot and enter your token into the config file.

Last.fm

  1. Create an API account
  2. Enter the key and secret into the config file.

Genius

  1. Go to your API Clients
  2. Create one and enter the 'client access token' into the config file.

Spotify

  1. Go to the Spotify Developer dashboard
  2. Create an app and enter both the ID and the secret into the config file.

Google (used for youtube):

  1. Create a project in the developer console
  2. Enable the Youtube Data API v3 for the project.
  3. In project credentials, create an API key
  4. Enter the API key in the config file.