forked from engineering/cloudservices
modlogs cmd fix
parent
a87e108ee6
commit
9e88f0f8fe
|
@ -23,8 +23,6 @@ export default class Modlogs extends Command {
|
||||||
|
|
||||||
const formatted = query.map((log) => {
|
const formatted = query.map((log) => {
|
||||||
const { username, moderatorID, reason, type, date } = log;
|
const { username, moderatorID, reason, type, date } = log;
|
||||||
this.client.signale.debug(log);
|
|
||||||
this.client.signale.debug(type);
|
|
||||||
let name: string;
|
let name: string;
|
||||||
if (type === 0) {
|
if (type === 0) {
|
||||||
name = 'Create';
|
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 value = `**Account name:** ${username}\n**Moderator:** <@${moderatorID}>\n**Reason:** ${reason}\n**Date:** ${date.toLocaleString('en-us')} EST`;
|
||||||
const inline = true;
|
const inline = true;
|
||||||
this.client.signale.debug(name);
|
|
||||||
return { name, value, inline };
|
return { name, value, inline };
|
||||||
});
|
});
|
||||||
const users = [...new Set(query.map((log) => log.userID))].map((u) => `<@${u}>`);
|
const users = [...new Set(query.map((log) => log.userID))].map((u) => `<@${u}>`);
|
||||||
|
@ -59,7 +56,12 @@ export default class Modlogs extends Command {
|
||||||
return embed;
|
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;
|
return msg;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return this.client.util.handleError(error, message, this);
|
return this.client.util.handleError(error, message, this);
|
||||||
|
|
Loading…
Reference in New Issue