performance fixes

pull/29/head
Matthew 2020-11-28 02:02:29 -05:00
parent 9bfcacae0f
commit 687e767565
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
2 changed files with 8 additions and 2 deletions

View File

@ -15,7 +15,7 @@ export default class Queue {
constructor(client: Client) {
this.client = client;
this.queues = {
score: new Bull('score', { prefix: 'queue::score', limiter: { max: 80, duration: 1000 } }),
score: new Bull('score', { prefix: 'queue::score' }),
};
this.setProcessors();
this.setCronJobs();

View File

@ -17,7 +17,13 @@ export default class Notes extends Command {
try {
if (!args[0]) return this.client.commands.get('help').run(message, [this.name]);
let member: Member | User = this.client.util.resolveMember(args[0], this.mainGuild);
if (!member) member = await this.client.getRESTUser(args[0]);
if (!member) {
try {
member = await this.client.getRESTUser(args[0]);
} catch {
member = undefined;
}
}
if (!member) return this.error(message.channel, 'User specified could not be found.');
const notes = await this.client.db.Note.find({ userID: member.id });