Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
Update Discord js_unread.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGoddessInari committed Mar 2, 2022
1 parent 6f435a3 commit aeb5a15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/store/ServicesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Ext.define('Hamsket.store.ServicesList', {
,url: 'https://discordapp.com/login'
,type: 'messaging'
,titleBlink: true
,js_unread: `let getMentionCount=badges=>{let alerts=0;for(const badge of badges)alerts+=parseInt(badge.innerText,10)||0;return alerts},getServerUnread=badges=>{let alerts=0;for(const badge of badges)alerts+="1"===badge.style.opacity&&"8px"===badge.style.height?1:0;return alerts},checkUnread=()=>{const mentions=document.querySelectorAll(".lowerBadge-29hYVK > .numberBadge-2s8kKX");unread=document.getElementsByClassName("item-2hkk8m");const direct=getMentionCount(mentions);let indirect=getServerUnread(unread);indirect+=document.getElementsByClassName("unread-3zKkbm").length,hamsket.updateBadge(direct,indirect)};setInterval(checkUnread,3e3);`
,js_unread: `const getMentionCount=badges=>{let alerts=0;for(const badge of badges)alerts+=hamsket.parseIntOrZero(badge.textContent);return alerts},getServerUnread=badges=>{let alerts=0;for(const badge of badges)alerts+="1"===badge.style.opacity&&"8px"===badge.style.height?1:0;return alerts},checkUnread=()=>{const mentions=document.querySelectorAll('[class*="lowerBadge-"] > [class*="numberBadge-"]'),unread=document.querySelectorAll('[class*="pill-"] > [class*="item-"]'),direct=getMentionCount(mentions),indirect=getServerUnread(unread);hamsket.updateBadge(direct,indirect)};setInterval(checkUnread,3e3);`
,note: 'To enable desktop notifications, you have to go to Options inside Discord.'
},
{
Expand Down

0 comments on commit aeb5a15

Please sign in to comment.