Nertivia-Client/src/utils/ElectronJS/DesktopNotification.js
2019-12-12 11:31:29 +00:00

31 lines
768 B
JavaScript

module.exports = {
directMessage({ username, avatarURL, message }) {
let myNotification = new Notification(`${username}`, {
body: message,
icon: avatarURL,
silent: true
});
myNotification.onclick = () => {
console.log("CLICK");
};
myNotification.onclose = () => {
myNotification = null;
};
},
serverMessage({ serverName, channelName, username, avatarURL, message }) {
let myNotification = new Notification(
`${username} in ${serverName}#${channelName}`,
{
body: message,
icon: avatarURL,
silent: true
}
);
myNotification.onclick = () => {
console.log("CLICK");
};
myNotification.onclose = () => {
myNotification = null;
};
}
};