From fad1abf579aa867c98eebe658d902e9cf0d30673 Mon Sep 17 00:00:00 2001 From: Isaac Date: Wed, 5 Oct 2022 18:21:53 +0100 Subject: [PATCH] log ticket update --- src/commands/slash/priority.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/commands/slash/priority.js b/src/commands/slash/priority.js index 00675ff..9274fc9 100644 --- a/src/commands/slash/priority.js +++ b/src/commands/slash/priority.js @@ -1,6 +1,7 @@ const { SlashCommand } = require('@eartharoid/dbf'); const { ApplicationCommandOptionType } = require('discord.js'); const ExtendedEmbedBuilder = require('../../lib/embed'); +const { logTicketEvent } = require('../../lib/logging'); module.exports = class PrioritySlashCommand extends SlashCommand { constructor(client, options) { @@ -112,11 +113,25 @@ module.exports = class PrioritySlashCommand extends SlashCommand { else name = this.getEmoji(priority) + name; await interaction.channel.setName(name); + // don't reassign ticket because the original is used below await client.prisma.ticket.update({ data: { priority }, where: { id: interaction.channel.id }, }); + logTicketEvent(this.client, { + action: 'update', + diff: { + original: { priority: ticket.priority }, + updated: { priority: priority }, + }, + target: { + id: ticket.id, + name: `<#${ticket.id}>`, + }, + userId: interaction.user.id, + }); + return await interaction.editReply({ embeds: [ new ExtendedEmbedBuilder({