Skip to main content

A basic Discord bot to listen music using the Subsonic API

Project description

Disopy

A basic Discord bot for Subsonic

Installation

$ pip install dispoy
$ disopy # First run to generate the default config file

Disopy supports Python 3.11 and newer.

Configuration

The cofig file is located in $XDG_CONFIG_PATH/disopy/disopy.json, in most cases you'll see it as ~/.config/disopy/disopy.json. The default config file looks like this:

{
  "subsonic": {
    "subsonicUrl": "https://",
    "username": "",
    "password": ""
  },
  "discordToken": "",
  "caCertsPath": ""
}

Fill it up with your data. The deploy of the bot in Discord won't be covered in this document as it's already explained in the Discord Developer Portal and other sources. See Custom certs for more info about self signed certificates.

Using

After you have your Discord Application created and invited the bot to a server start it with:

$ disopy

Wait until it reports a successful connection to the Discord and Subsonic APIs, then enjoy the power of selfhosting using slash commands (/command) in a text channel. All slash commands are self-explanatory by its descriptions.

Custom CA Certs

If you want to use custom certs you can point a unencrypted PEM file in "caCertsPath" in the configuration. Tip: If you just want to use the certificates installed in your machine instead of the ones bundled in the requests package you can set it as "caCertsPath": "/etc/ssl/certs/ca-certificates.crt" and in most cases, it will work.

Quirks

The Subsonic API search implementation doesn't support playlists so the search for them is made with a plain substring search making it more difficult to find the desired playlist. If anyone makes a better implementation of it feel free to contribute to the project with it.

Author

Created with :heart: by Kutu.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

disopy-1.0.0.tar.gz (9.6 kB view hashes)

Uploaded Source

Built Distribution

disopy-1.0.0-py3-none-any.whl (10.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page