Sort by date
parent
af6ba645f8
commit
8b47fba0ba
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue