feat: feedback, start of close requests

This commit is contained in:
Isaac
2023-01-13 20:48:37 +00:00
parent d7e1b05586
commit 8bf01aa520
16 changed files with 293 additions and 59 deletions

View File

@@ -8,5 +8,24 @@ module.exports = class FeedbackModal extends Modal {
});
}
async run(id, interaction) { }
async run(id, interaction) {
/** @type {import("client")} */
const client = this.client;
await interaction.deferReply();
await client.prisma.ticket.update({
data: {
feedback: {
create: {
comment: interaction.fields.getTextInputValue('comment'),
guild: { connect: { id: interaction.guild.id } },
rating: parseInt(interaction.fields.getTextInputValue('rating')) || null,
user: { connect: { id: interaction.user.id } },
},
},
},
where: { id: interaction.channel.id },
});
await client.tickets.requestClose(interaction, id.reason);
}
};