mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-07 18:41:26 +03:00
feat: feedback, start of close requests
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user