mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-02-23 02:41:21 +02:00
fix: handle missing ticket on/move
and /transfer
This commit is contained in:
parent
73ff67c65f
commit
1f24561ac0
@ -47,15 +47,15 @@ module.exports = class MoveSlashCommand extends SlashCommand {
|
||||
});
|
||||
|
||||
if (!ticket) {
|
||||
const { locale } = await client.prisma.guild.findUnique({ where: { id: interaction.guild.id } });
|
||||
const getMessage = client.i18n.getLocale(locale);
|
||||
const settings = await client.prisma.guild.findUnique({ where: { id: interaction.guild.id } });
|
||||
const getMessage = client.i18n.getLocale(settings.locale);
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
new ExtendedEmbedBuilder({
|
||||
iconURL: interaction.guild.iconURL(),
|
||||
text: ticket.guild.footer,
|
||||
text: settings.footer,
|
||||
})
|
||||
.setColor(ticket.guild.errorColour)
|
||||
.setColor(settings.errorColour)
|
||||
.setTitle(getMessage('misc.not_ticket.title'))
|
||||
.setDescription(getMessage('misc.not_ticket.description')),
|
||||
],
|
||||
|
@ -3,6 +3,7 @@ const {
|
||||
ApplicationCommandOptionType,
|
||||
EmbedBuilder,
|
||||
} = require('discord.js');
|
||||
const ExtendedEmbedBuilder = require('../../lib/embed');
|
||||
const { quick } = require('../../lib/threads');
|
||||
|
||||
|
||||
@ -50,6 +51,23 @@ module.exports = class TransferSlashCommand extends SlashCommand {
|
||||
where: { id: interaction.channel.id },
|
||||
});
|
||||
|
||||
if (!ticket) {
|
||||
const settings = await client.prisma.guild.findUnique({ where: { id: interaction.guild.id } });
|
||||
const getMessage = client.i18n.getLocale(settings.locale);
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
new ExtendedEmbedBuilder({
|
||||
iconURL: interaction.guild.iconURL(),
|
||||
text: settings.footer,
|
||||
})
|
||||
.setColor(settings.errorColour)
|
||||
.setTitle(getMessage('misc.not_ticket.title'))
|
||||
.setDescription(getMessage('misc.not_ticket.description')),
|
||||
],
|
||||
ephemeral: true,
|
||||
});
|
||||
}
|
||||
|
||||
const from = ticket.createdById;
|
||||
|
||||
const channelName = ticket.category.channelName
|
||||
|
Loading…
x
Reference in New Issue
Block a user