Skip to content

Commit

Permalink
fix: add padding for state
Browse files Browse the repository at this point in the history
Because Discord needs state string's length at least two, we add padding for the album's name is only one character
  • Loading branch information
aokblast committed Sep 21, 2023
1 parent 5e046e5 commit 5f80af1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ async function SongChanged(core, data) {
const activity = {
type: 2, // Doesn't work. (https://discord-api-types.dev/api/discord-api-types-v10/enum/ActivityType)
details: data.now_playing.one_line.line1.substring(0, 128),
state: data.now_playing.three_line.line3.substring(0, 128),
state: data.now_playing.three_line.line3.substring(0, 128) + (data.now_playing.three_line.line3.length < 2 ? " " : ""),
endTimestamp,
instance: false,
largeImageKey: (image_key === PreviousAlbumArt.imageKey)? PreviousAlbumArt.imageUrl : 'roon_labs_logo',
Expand Down

0 comments on commit 5f80af1

Please sign in to comment.