mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-23 08:13:09 +02:00
log ticket update
This commit is contained in:
parent
3f8663675d
commit
fad1abf579
@ -1,6 +1,7 @@
|
|||||||
const { SlashCommand } = require('@eartharoid/dbf');
|
const { SlashCommand } = require('@eartharoid/dbf');
|
||||||
const { ApplicationCommandOptionType } = require('discord.js');
|
const { ApplicationCommandOptionType } = require('discord.js');
|
||||||
const ExtendedEmbedBuilder = require('../../lib/embed');
|
const ExtendedEmbedBuilder = require('../../lib/embed');
|
||||||
|
const { logTicketEvent } = require('../../lib/logging');
|
||||||
|
|
||||||
module.exports = class PrioritySlashCommand extends SlashCommand {
|
module.exports = class PrioritySlashCommand extends SlashCommand {
|
||||||
constructor(client, options) {
|
constructor(client, options) {
|
||||||
@ -112,11 +113,25 @@ module.exports = class PrioritySlashCommand extends SlashCommand {
|
|||||||
else name = this.getEmoji(priority) + name;
|
else name = this.getEmoji(priority) + name;
|
||||||
await interaction.channel.setName(name);
|
await interaction.channel.setName(name);
|
||||||
|
|
||||||
|
// don't reassign ticket because the original is used below
|
||||||
await client.prisma.ticket.update({
|
await client.prisma.ticket.update({
|
||||||
data: { priority },
|
data: { priority },
|
||||||
where: { id: interaction.channel.id },
|
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({
|
return await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
new ExtendedEmbedBuilder({
|
new ExtendedEmbedBuilder({
|
||||||
|
Loading…
Reference in New Issue
Block a user