mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-02-23 10:51:22 +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) {
|
if (!ticket) {
|
||||||
const { locale } = await client.prisma.guild.findUnique({ where: { id: interaction.guild.id } });
|
const settings = await client.prisma.guild.findUnique({ where: { id: interaction.guild.id } });
|
||||||
const getMessage = client.i18n.getLocale(locale);
|
const getMessage = client.i18n.getLocale(settings.locale);
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
new ExtendedEmbedBuilder({
|
new ExtendedEmbedBuilder({
|
||||||
iconURL: interaction.guild.iconURL(),
|
iconURL: interaction.guild.iconURL(),
|
||||||
text: ticket.guild.footer,
|
text: settings.footer,
|
||||||
})
|
})
|
||||||
.setColor(ticket.guild.errorColour)
|
.setColor(settings.errorColour)
|
||||||
.setTitle(getMessage('misc.not_ticket.title'))
|
.setTitle(getMessage('misc.not_ticket.title'))
|
||||||
.setDescription(getMessage('misc.not_ticket.description')),
|
.setDescription(getMessage('misc.not_ticket.description')),
|
||||||
],
|
],
|
||||||
|
@ -3,6 +3,7 @@ const {
|
|||||||
ApplicationCommandOptionType,
|
ApplicationCommandOptionType,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
} = require('discord.js');
|
} = require('discord.js');
|
||||||
|
const ExtendedEmbedBuilder = require('../../lib/embed');
|
||||||
const { quick } = require('../../lib/threads');
|
const { quick } = require('../../lib/threads');
|
||||||
|
|
||||||
|
|
||||||
@ -50,6 +51,23 @@ module.exports = class TransferSlashCommand extends SlashCommand {
|
|||||||
where: { id: interaction.channel.id },
|
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 from = ticket.createdById;
|
||||||
|
|
||||||
const channelName = ticket.category.channelName
|
const channelName = ticket.category.channelName
|
||||||
|
Loading…
x
Reference in New Issue
Block a user