Add Red music bot support (and fix a small null reference bug) #268
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for Red as a music bot.
The way that I've done this integration (since Red is a self-hosted bot) is to make the name of the bot configurable via
.configuration
. If this would be better done some other way I'd be happy to make changes to that effect.Additionally, a issue I've run into is that artist and song title will sometimes be reversed (especially if the upload channel is the name of the artist, or a "topic channel"); this PR adds a check for which order has the most listeners on Last.fm and uses the one that's higher. If that's too big of a change, it might make sense to check for "- Topic" specifically and flip the artist/title around only if it's a topic channel (which will miss more wrong-way-around scrobbles, but be a smaller change.)
I also fixed #267 in the process (which was preventing me from running the bot in the first place.)
(I'd also be happy to DM anyone an invite link for my personal Red bot instance for testing, if needed)