mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-04 09:21:25 +03:00
fix command options & types
and start on closing
This commit is contained in:
@@ -30,7 +30,7 @@ module.exports = async client => {
|
||||
const guild = client.guilds.cache.get(ticket.guildId);
|
||||
if (guild && guild.available && !client.channels.cache.has(ticket.id)) {
|
||||
deleted += 0;
|
||||
await client.tickets.close(ticket.id);
|
||||
await client.tickets.close(ticket.id, true, 'channel deleted');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -91,7 +91,7 @@ module.exports = class TicketManager {
|
||||
/**
|
||||
* @param {object} data
|
||||
* @param {string} data.categoryId
|
||||
* @param {import("discord.js").ButtonInteraction|import("discord.js").SelectMenuInteraction} data.interaction
|
||||
* @param {import("discord.js").ChatInputCommandInteraction|import("discord.js").ButtonInteraction|import("discord.js").SelectMenuInteraction} data.interaction
|
||||
* @param {string?} [data.topic]
|
||||
*/
|
||||
async create({
|
||||
@@ -634,4 +634,32 @@ module.exports = class TicketManager {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {import("discord.js").ChatInputCommandInteraction|import("discord.js").ButtonInteraction} interaction
|
||||
*/
|
||||
async preClose(interaction) {
|
||||
const ticket = await this.client.prisma.ticket.findUnique({
|
||||
include: {
|
||||
category: true,
|
||||
guild: true,
|
||||
},
|
||||
where: { id: interaction.channel.id },
|
||||
});
|
||||
const getMessage = this.client.i18n.getLocale(ticket.guild.locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* close a ticket
|
||||
* @param {string} ticketId
|
||||
* @param {boolean} skip
|
||||
* @param {string} reason
|
||||
*/
|
||||
async close(ticketId, skip, reason) {
|
||||
// TODO: update cache/cat count
|
||||
// TODO: update cache/member count
|
||||
// TODO: set messageCount on ticket
|
||||
// delete
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user