mirror of
https://github.com/danbulant/Nertivia-Client
synced 2026-06-16 04:51:16 +00:00
31 lines
768 B
JavaScript
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;
|
|
};
|
|
}
|
|
};
|