<%- include("partials/layout-top", { title }) %>

Custom commands

<% const platformLabelMap = new Map((platforms || []).map((item) => [item.id, item.label])); %>
<% (platforms || []).forEach((platform) => { %> <% }) %>
<% if (!platforms || !platforms.length) { %>

Enable platforms in Platform Integration to assign them here.

<% } %>
<% if (isAdmin) { %>
<% } else { %> <% } %>
<% if (isAdmin) { %>
<% } %>
<% if (isAdmin) { %>

Dynamic commands must export a run(ctx) function. Return a string to reply.

<% } else { %>

Moderators can create static text commands only.

<% } %>

Existing commands

<% if (!commands.length) { %>

No commands created yet.

<% } else { %> <% commands.forEach((command) => { %> <% }) %>
Trigger Response Status Actions
<%= command.trigger %>
<% (command.platforms || []).forEach((platform) => { %> <%= platformLabelMap.get(platform) || platform %> <% }) %> <% if (command.mode !== "advanced") { %> <%= command.response %> <% } else if (command.preview.status === "ready") { %> <% command.preview.compactParts.forEach((part) => { %> <% if (part.dynamic) { %><%= part.text %><% } else { %><%= part.text %><% } %> <% }) %> <% if (command.preview.isLong) { %>
Full preview
<% command.preview.fullParts.forEach((part) => { %> <% if (part.dynamic) { %><%= part.text %><% } else { %><%= part.text %><% } %> <% }) %>
<% } %> <% } else { %> Preview unavailable <% if (isAdmin) { %>
Details <%= command.preview.error %>
<% } %> <% } %>
<%= command.enabled ? "Enabled" : "Disabled" %>
<% if (isAdmin && command.mode === "advanced") { %>
<% } %> <% if (isAdmin || command.mode === "plain") { %> <% } %>
<% (platforms || []).forEach((platform) => { %> <% }) %>
<% if (isAdmin) { %>
<% } else { %> <% } %>
<% if (isAdmin) { %>
<% } %>
<% if (!isAdmin && command.mode === 'advanced') { %>

Dynamic commands can only be edited by admins.

<% } %>
<% } %>
<%- include("partials/layout-bottom") %>