1
0
Fork 0

modlogs cmd fix

refactor/models
Matthew 2019-10-27 23:58:41 -04:00
parent a87e108ee6
commit 9e88f0f8fe
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 6 additions and 4 deletions

View File

@ -23,8 +23,6 @@ export default class Modlogs extends Command {
const formatted = query.map((log) => {
const { username, moderatorID, reason, type, date } = log;
this.client.signale.debug(log);
this.client.signale.debug(type);
let name: string;
if (type === 0) {
name = 'Create';
@ -39,7 +37,6 @@ export default class Modlogs extends Command {
}
const value = `**Account name:** ${username}\n**Moderator:** <@${moderatorID}>\n**Reason:** ${reason}\n**Date:** ${date.toLocaleString('en-us')} EST`;
const inline = true;
this.client.signale.debug(name);
return { name, value, inline };
});
const users = [...new Set(query.map((log) => log.userID))].map((u) => `<@${u}>`);
@ -59,7 +56,12 @@ export default class Modlogs extends Command {
return embed;
});
createPaginationEmbed(message, this.client, embeds, {}, msg);
if (embeds.length === 1) {
// @ts-ignore
message.channel.createMessage({ embed: embeds[0] });
} else {
createPaginationEmbed(message, this.client, embeds, {}, msg);
}
return msg;
} catch (error) {
return this.client.util.handleError(error, message, this);