1
0
Fork 0

fix modlogs

refactor/models
Matthew 2020-09-22 15:17:41 -04:00
parent d6757feaae
commit 4164138e84
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ export default class Modlogs extends Command {
try {
if (!args.length) return this.client.commands.get('help').run(message, [this.name]);
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(' ')}***`);
const formatted = query.sort((a, b) => a.date.getTime() - b.date.getTime()).map((log) => {