fix(logging): don't send empty changelogs

The previous fix didn't work because `{}` is true, not false as expected.
This commit is contained in:
Isaac 2022-10-25 22:53:12 +01:00
parent 066eb954e3
commit 7812e62776
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -109,7 +109,7 @@ async function logAdminEvent(client, {
]),
];
if (diff?.original && makeDiff(diff)) {
if (diff?.original && Object.entries(makeDiff(diff)).length) {
embeds.push(
new EmbedBuilder()
.setColor(colour)
@ -171,7 +171,7 @@ async function logTicketEvent(client, {
]),
];
if (diff?.original && makeDiff(diff)) {
if (diff?.original && Object.entries(makeDiff(diff)).length) {
embeds.push(
new EmbedBuilder()
.setColor(colour)
@ -223,7 +223,7 @@ async function logMessageEvent(client, {
]),
];
if (diff?.original && makeDiff(diff)) {
if (diff?.original && Object.entries(makeDiff(diff)).length) {
embeds.push(
new EmbedBuilder()
.setColor(colour)