From 587818b91ed0730bb75c421f27405a3e1038c4e4 Mon Sep 17 00:00:00 2001 From: Constantin Piber Date: Tue, 5 Oct 2021 10:10:36 +0200 Subject: [PATCH] Add type, clear on close --- plugins/discord/back.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/discord/back.js b/plugins/discord/back.js index 8f0cc614..478af101 100644 --- a/plugins/discord/back.js +++ b/plugins/discord/back.js @@ -97,7 +97,10 @@ module.exports = (win, {activityTimoutEnabled, activityTimoutTime}) => { } // 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 = { + type: 2, // Listening, addressed in https://github.com/discordjs/RPC/pull/149 details: songInfo.title, state: songInfo.artist, largeImageKey: "logo", @@ -133,6 +136,7 @@ module.exports = (win, {activityTimoutEnabled, activityTimoutTime}) => { registerCallback(updateActivity); connect(); }); + win.on("close", () => module.exports.clear()); }; module.exports.clear = () => {