Add list shortcodes to status command output (#312)

This commit is contained in:
Denis Lisov 2022-09-14 12:32:14 +03:00 committed by GitHub
parent 4d5447cb50
commit 89b7ec1a18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,8 +75,8 @@ async function showMjolnirStatus(roomId: string, event: any, mjolnir: Mjolnir) {
text += "Subscribed ban lists:\n";
for (const list of mjolnir.lists) {
const ruleInfo = `rules: ${list.serverRules.length} servers, ${list.userRules.length} users, ${list.roomRules.length} rooms`;
html += `<li><a href="${list.roomRef}">${list.roomId}</a> (${ruleInfo})</li>`;
text += `* ${list.roomRef} (${ruleInfo})\n`;
html += `<li>${htmlEscape(list.listShortcode)} @ <a href="${list.roomRef}">${list.roomId}</a> (${ruleInfo})</li>`;
text += `* ${list.listShortcode} @ ${list.roomRef} (${ruleInfo})\n`;
}
if (mjolnir.lists.length === 0) {
html += "<li><i>None</i></li>";