fix: ticket perms #5

Merged
cosmic merged 1 commits from ananas/scythe:fix/perms into main 2025-03-30 18:41:02 +00:00
1 changed files with 10 additions and 1 deletions
Showing only changes of commit e0eb4e4731 - Show all commits

View File

@ -24,6 +24,7 @@ export class TicketComponenets {
.select() .select()
.from(ticketsTable) .from(ticketsTable)
.where(eq(ticketsTable.user, inter.user.id)); .where(eq(ticketsTable.user, inter.user.id));
if (check.length >= 1) { if (check.length >= 1) {
await inter.reply({ await inter.reply({
content: "You already have a ticket open.", content: "You already have a ticket open.",
@ -54,12 +55,20 @@ export class TicketComponenets {
PermissionsBitField.Flags.SendMessages, PermissionsBitField.Flags.SendMessages,
], ],
}, },
{
id: inter.client.user.id,
allow: [
PermissionsBitField.Flags.ViewChannel,
PermissionsBitField.Flags.SendMessages
],
}
], ],
}); });
const category = inter.guild?.channels.cache.get( const category = inter.guild!.channels.cache.get(
Bun.env.TICKET_CATEGORY, Bun.env.TICKET_CATEGORY,
) as CategoryChannel; ) as CategoryChannel;
channel = await channel.setParent(category); channel = await channel.setParent(category);
const embed = new EmbedBuilder() const embed = new EmbedBuilder()