Fix discord clearActivity, menu

The callback sends multiple events, in particular two pause when going to the
next song, so the timeout wasn't properly cleared.
Add menu buttons for the two options
This commit is contained in:
Constantin Piber
2021-08-15 12:20:37 +02:00
parent c6f8c42c45
commit 183bad43f6
2 changed files with 30 additions and 4 deletions

21
plugins/discord/menu.js Normal file
View File

@ -0,0 +1,21 @@
const { setOptions } = require("../../config/plugins");
const { edit } = require("../../config");
module.exports = (win, options) => [
{
label: "Clear activity after timeout",
type: "checkbox",
checked: options.activityTimoutEnabled,
click: (item) => {
options.activityTimoutEnabled = item.checked;
setOptions('discord', options);
},
},
{
label: "Set timeout time in config",
click: () => {
// open config.json
edit();
},
},
];