1
0
Fork 0

Sort by date

refactor/models
Bsian 2019-11-02 16:17:55 +00:00
parent af6ba645f8
commit 8b47fba0ba
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
1 changed files with 2 additions and 1 deletions

View File

@ -21,7 +21,8 @@ export default class Modlogs extends Command {
const query = await this.client.db.Moderation.find({ $or: [{ username: args.join(' ') }, { userID: args.filter((a) => a)[0].replace(/[<@!>]/g, '') }] }); const query = await this.client.db.Moderation.find({ $or: [{ username: args.join(' ') }, { userID: args.filter((a) => a)[0].replace(/[<@!>]/g, '') }] });
if (!query.length) return msg.edit(`***${this.client.stores.emojis.error} Cannot locate modlogs for ${args.join(' ')}***`); if (!query.length) return msg.edit(`***${this.client.stores.emojis.error} Cannot locate modlogs for ${args.join(' ')}***`);
const formatted = query.map((log) => { // @ts-ignore
const formatted = query.sort((a, b) => a.date - b.date).map((log) => {
const { username, moderatorID, reason, type, date } = log; const { username, moderatorID, reason, type, date } = log;
let name: string; let name: string;
switch (type) { switch (type) {