limit report history docs to 31
parent
daa51fc79a
commit
d3c631f25f
|
@ -27,7 +27,7 @@ export default class Score_Hist extends Command {
|
||||||
if (!args[0] || !this.checkCustomPermissions(this.client.util.resolveMember(message.author.id, this.mainGuild), 4)) {
|
if (!args[0] || !this.checkCustomPermissions(this.client.util.resolveMember(message.author.id, this.mainGuild), 4)) {
|
||||||
user = message.author;
|
user = message.author;
|
||||||
if (!user) return this.error(message.channel, 'Member not found.');
|
if (!user) return this.error(message.channel, 'Member not found.');
|
||||||
const hists = await this.client.db.ScoreHistorical.find({ userID: user.id }).lean().exec();
|
const hists = await this.client.db.ScoreHistorical.find({ userID: user.id }).limit(31).lean().exec();
|
||||||
if (!hists) return this.error(message.channel, 'No history found.');
|
if (!hists) return this.error(message.channel, 'No history found.');
|
||||||
if (hists.length < 1) return this.error(message.channel, 'No history found.');
|
if (hists.length < 1) return this.error(message.channel, 'No history found.');
|
||||||
const histArray: [{ name: string, value: string }?] = [];
|
const histArray: [{ name: string, value: string }?] = [];
|
||||||
|
@ -177,7 +177,7 @@ export default class Score_Hist extends Command {
|
||||||
user = this.client.util.resolveMember(sc.userID, this.mainGuild)?.user;
|
user = this.client.util.resolveMember(sc.userID, this.mainGuild)?.user;
|
||||||
}
|
}
|
||||||
if (!user) return this.error(message.channel, 'Member not found.');
|
if (!user) return this.error(message.channel, 'Member not found.');
|
||||||
const hists = await this.client.db.ScoreHistorical.find({ userID: user.id }).lean().exec();
|
const hists = await this.client.db.ScoreHistorical.find({ userID: user.id }).limit(31).lean().exec();
|
||||||
if (!hists) return this.error(message.channel, 'No history found.');
|
if (!hists) return this.error(message.channel, 'No history found.');
|
||||||
if (hists.length < 1) return this.error(message.channel, 'No history found.');
|
if (hists.length < 1) return this.error(message.channel, 'No history found.');
|
||||||
const histArray: [{ name: string, value: string }?] = [];
|
const histArray: [{ name: string, value: string }?] = [];
|
||||||
|
|
Loading…
Reference in New Issue