fix modlogs
parent
d6757feaae
commit
4164138e84
|
@ -16,7 +16,7 @@ export default class Modlogs extends Command {
|
||||||
try {
|
try {
|
||||||
if (!args.length) return this.client.commands.get('help').run(message, [this.name]);
|
if (!args.length) return this.client.commands.get('help').run(message, [this.name]);
|
||||||
const msg: Message = await this.loading(message.channel, 'Locating modlogs...');
|
const msg: Message = await this.loading(message.channel, 'Locating modlogs...');
|
||||||
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[0] }] });
|
||||||
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.sort((a, b) => a.date.getTime() - b.date.getTime()).map((log) => {
|
const formatted = query.sort((a, b) => a.date.getTime() - b.date.getTime()).map((log) => {
|
||||||
|
|
Loading…
Reference in New Issue