mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-15 04:11:47 +00:00
Add type, clear on close
This commit is contained in:
@ -97,7 +97,10 @@ module.exports = (win, {activityTimoutEnabled, activityTimoutTime}) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Song information changed, so lets update the rich presence
|
// Song information changed, so lets update the rich presence
|
||||||
|
// @see https://discord.com/developers/docs/topics/gateway#activity-object
|
||||||
|
// not all options are transfered through https://github.com/discordjs/RPC/blob/6f83d8d812c87cb7ae22064acd132600407d7d05/src/client.js#L518-530
|
||||||
const activityInfo = {
|
const activityInfo = {
|
||||||
|
type: 2, // Listening, addressed in https://github.com/discordjs/RPC/pull/149
|
||||||
details: songInfo.title,
|
details: songInfo.title,
|
||||||
state: songInfo.artist,
|
state: songInfo.artist,
|
||||||
largeImageKey: "logo",
|
largeImageKey: "logo",
|
||||||
@ -133,6 +136,7 @@ module.exports = (win, {activityTimoutEnabled, activityTimoutTime}) => {
|
|||||||
registerCallback(updateActivity);
|
registerCallback(updateActivity);
|
||||||
connect();
|
connect();
|
||||||
});
|
});
|
||||||
|
win.on("close", () => module.exports.clear());
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.clear = () => {
|
module.exports.clear = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user