More customizable Discord-Presence #332
Merged
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 two features to enhance the user's control over the discord integration:
Detailed description
To implement these features, this PR introduces three new settings in the
discord
section of the configuration:showSong
(boolean): This setting determines whether the current song is shown in the discord activity or not. If set totrue
, the current song will be displayed as usual. If set tofalse
, the custom text specified by thelisteningText
setting will be shown instead.idleText
(string): This setting specifies the text that is shown in the discord activity when no song is playing. The default value isBrowsing Tidal
.listeningText
(string): This setting specifies the text that is shown in the discord activity when a song is playing and theshowSong
setting is set tofalse
. The default value isListening Tidal
.To handle the different scenarios, this PR also introduces a new function in
src/scripts/discord.ts
:getActivity
: This function returns the appropriatePresence
object based on the current song and the settings. It is used by the other functions in the same file to update the discord activity.This PR does not include a migration for the storage, as it is uncertain when or if this code will be merged.
I would like to thank the owners and contributors of this project for creating and maintaining this awesome project. I hope this PR will be useful and welcome.