mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-23 08:13:09 +02:00
Fix diff
This commit is contained in:
parent
5aac998bee
commit
3e3ac50f08
@ -8,9 +8,12 @@ function makeDiff({
|
|||||||
const fields = [];
|
const fields = [];
|
||||||
for (const key in diff) {
|
for (const key in diff) {
|
||||||
if (key === 'createdAt') continue; // object-diffy doesn't like dates
|
if (key === 'createdAt') continue; // object-diffy doesn't like dates
|
||||||
|
const from = diff[key].from === null ? '' : `- ${diff[key].from}\n`;
|
||||||
|
const to = diff[key].to === null ? '' : `+ ${diff[key].to}\n`;
|
||||||
fields.push({
|
fields.push({
|
||||||
|
inline: true,
|
||||||
name: key,
|
name: key,
|
||||||
value: `\`\`\`diff\n${diff[key].from && `- ${diff[key].from}\n`}\n${diff[key].to && `+ ${diff[key].to}\n`}\n\`\`\``,
|
value: `\`\`\`diff\n${from + to}\n\`\`\``,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return fields;
|
return fields;
|
||||||
@ -98,10 +101,10 @@ async function logAdminEvent(client, {
|
|||||||
// text: settings.footer,
|
// text: settings.footer,
|
||||||
// }),
|
// }),
|
||||||
...[
|
...[
|
||||||
diff &&
|
diff?.original &&
|
||||||
new MessageEmbed()
|
new MessageEmbed()
|
||||||
.setColor('ORANGE')
|
.setColor('ORANGE')
|
||||||
.setTitle(getMessage('log.admin.differences'))
|
.setTitle(getMessage('log.admin.changes'))
|
||||||
.setFields(makeDiff(diff)),
|
.setFields(makeDiff(diff)),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user