Automated music streaming service link converter for Discord.
GPL-3.0 License
While each provider has its own authentication requirements, the bot will at minimum require a Discord bot. To create one, follow the steps below:
bot
Send Messages
Read Messages
Message Content
toggle under Privileged Gateway Intents
https://discord.com/api/oauth2/authorize?client_id=<client_id>&permissions=3072&scope=bot
Set the following environment variables:
MIKU_DISCORD_TOKEN="<Discord Bot Token From Step 3>"
# Optional: Limit to single channel.
MIKU_DISCORD_CHANNEL_ID="<Discord Channel ID>"
Below is specific instructions/requirements for a provider to be enabled.
Set the following environment variables:
MIKU_SPOTIFY_CLIENT_ID="<Client ID>"
MIKU_SPOTIFY_CLIENT_SECRET="<Client Secret>"
Note: Currently the API token will expire every 6 months and need to be regenerated. This will eventually be automated.
.p8
and have your Team ID and Key ID ready.go run github.com/minchao/go-apple-music/examples/token-generator@latest \
-l 15777000 -t "<Team_ID>" -pf "$HOME/Downloads/AuthKey_<Key_ID>.p8" \
-k "<Key_ID>"
Set the following environment variables:
MIKU_APPLE_MUSIC_API_TOKEN="<Generated Token From Step 3>"
Set the following environment variables:
MIKU_TIDAL_CLIENT_ID="<Client ID>"
MIKU_TIDAL_CLIENT_SECRET="<Client Secret>"
Setup a .env.development
using the provider documentation above.
Reference .env.example
to see all available options.
Export env vars from .env.development
:
set -o allexport && source .env.development && set +o allexport
Adding a new provider is fairly straight forward. The provider interface is only concerned with two things:
The interface is defined in the internal/streamingproviders
package.
The implementation of each function should be pretty straight forward, but there are some things that can be good to know:
Info
function, try to set all fields. ThisNew
function of a provider should fail if there is not enoughOnce you've implemented the provider, you can enable it by default by
adding it to the New
function in internal/handler/handler.go
. The
default providers are instantiated there to prevent an import cycle.
GPL-3.0