Merge pull request #380 from cpiber/discord

Fix discord clearActivity, menu, listen along option
This commit is contained in:
th-ch
2021-10-18 23:10:24 +02:00
committed by GitHub
5 changed files with 203 additions and 49 deletions

View File

@ -40,6 +40,9 @@ const getArtist = async (win) => {
}
// Fill songInfo with empty values
/**
* @typedef {songInfo} SongInfo
*/
const songInfo = {
title: "",
artist: "",
@ -72,6 +75,14 @@ const handleData = async (responseText, win) => {
const callbacks = [];
// This function will allow plugins to register callback that will be triggered when data changes
/**
* @callback songInfoCallback
* @param {songInfo} songInfo
* @returns {void}
*/
/**
* @param {songInfoCallback} callback
*/
const registerCallback = (callback) => {
callbacks.push(callback);
};