document.querySelectorAll('.top > .nick').forEach(function(n) {
const text = n.textContent;
!this.has(text) && this.add(text) || n.remove();
}, new Set);
или
[...document.querySelector('.top').children].reduce((acc, n) => {
const text = n.innerText;
acc.includes(text) ? n.parentNode.removeChild(n) : acc.push(text);
return acc;
}, []);
или
Object
.values(Array
.from(document.querySelectorAll('.top > .nick'))
.reduce((acc, n) => ((acc[n.innerText] ??= []).push(n), acc), {}))
.forEach(n => n.forEach((m, i) => i && (m.outerHTML = '')));
или
const el = document.querySelector('.top');
el.innerHTML = [...new Set(el.innerHTML.match(/<span.*?\/span>/g) ?? [])].join(' ');
или
const el = document.querySelector('.top');
el.innerHTML = Array
.from(el.getElementsByClassName('nick'), n => n.innerText)
.filter((n, i, a) => i === a.indexOf(n))
.reduce((acc, n) => acc + (acc && ' ') + `<span class="nick">${n}</span>`, '');