fix: log ticket closure even when there is no closer

This commit is contained in:
Isaac 2024-11-09 00:08:14 +00:00
parent 508a3932fc
commit 412c65c0ff
No known key found for this signature in database
GPG Key ID: 17700D08381EA590

View File

@ -1210,16 +1210,14 @@ module.exports = class TicketManager {
await channel.delete('Ticket closed' + (member ? ` by ${member.displayName}` : '') + reason ? `: ${reason}` : ''); await channel.delete('Ticket closed' + (member ? ` by ${member.displayName}` : '') + reason ? `: ${reason}` : '');
} }
if (closedBy) { logTicketEvent(this.client, {
logTicketEvent(this.client, { action: 'close',
action: 'close', target: {
target: { id: ticket.id,
id: ticket.id, name: `${ticket.category.name} **#${ticket.number}**`,
name: `${ticket.category.name} **#${ticket.number}**`, },
}, userId: closedBy || this.client.user.id,
userId: closedBy, });
});
}
try { try {
const creator = channel?.guild.members.cache.get(ticket.createdById); const creator = channel?.guild.members.cache.get(ticket.createdById);