display unresolved and total amount of infractions
This commit is contained in:
parent
971b91913b
commit
a12c9873ea
@ -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
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user