-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix: discord activity sanitizer #4119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Angelos Bouklis <me@arjix.dev>
ArjixWasTaken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| const activityInfo: SetActivity = { | ||
| type: ActivityType.Listening, | ||
| statusDisplayType: config.statusDisplayType, | ||
| details: truncateString(songInfo.alternativeTitle ?? songInfo.title, 128), // Song title |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please truncate the string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please elaborate, the newly added function already does truncation
Discord doesn't like it if activity text are less than 2 characters.
So I added extra function just for this and used an invisible non whitespace character to make it 2 characters or just simply return
"undefined"