display unresolved and total amount of infractions

This commit is contained in:
Erik 2022-09-10 10:48:36 +03:00
parent 971b91913b
commit a12c9873ea
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -101,6 +101,7 @@ class HistoryCommand extends SlashCommand {
const { infractions } = this.client.storageManager.mongodb; const { infractions } = this.client.storageManager.mongodb;
const resultsAmt = await infractions.count(query); const resultsAmt = await infractions.count(query);
const unresolvedAmt = await infractions.count({ ...query, resolved: false });
if (!resultsAmt) return { emoji: 'failure', index: 'COMMAND_HISTORY_NORESULTS' }; if (!resultsAmt) return { emoji: 'failure', index: 'COMMAND_HISTORY_NORESULTS' };
const maxPage = Math.ceil(resultsAmt / pageSize); const maxPage = Math.ceil(resultsAmt / pageSize);
@ -119,7 +120,7 @@ class HistoryCommand extends SlashCommand {
}, },
fields: [], fields: [],
footer: { footer: {
text: `• Page ${_page}/${maxPage} | ${resultsAmt} Results` text: `• Page ${_page}/${maxPage} | ${unresolvedAmt} (${resultsAmt}) Results`
}, },
color: me.roles.highest.color color: me.roles.highest.color
}; };