<% if (guilds && guilds.length) { %>
<% guilds.forEach(g => { %>
-
+
<% if (g.icon) { %>

<% } else { %>
S
<% } %>
<%= g.name %>
- <% if (typeof g.botInGuild === 'boolean' && !g.botInGuild) { %>
-
Invitar bot
- <% } %>
+
<% }) %>
<% } else { %>
@@ -121,6 +119,13 @@
Array.from(list.querySelectorAll('.guild-item')).forEach(it=>{
it.addEventListener('click', ()=>{
const id = it.getAttribute('data-id');
+ const bot = it.getAttribute('data-bot');
+ const invite = it.getAttribute('data-invite');
+ if (bot === '0' && invite) {
+ // open invite in a new tab
+ window.open(invite, '_blank', 'noopener');
+ return;
+ }
if (id) window.location.href = `/dashboard/${id}/overview`;
});
// keyboard activation (Enter / Space)