Fix BitField Error
This commit is contained in:
1 parent
ebe29b403e
commit
23acc0926f
2 files changed
+15
-10
No files matched your search
@@ -15,7 +15,7 @@ const Event = require("../Structures/Event.js");
|
||||
module.exports = new Event("interactionCreate", async (client, interaction) => {
|
||||
if (interaction.isCommand()) {
|
||||
const command = client.commands.find(
|
||||
(cmd) => cmd.name.toLowerCase() == interaction.commandName
|
||||
(cmd) => cmd.name.toLowerCase() === interaction.commandName
|
||||
);
|
||||
|
||||
if (interaction.user.bot || !interaction.guild) return;
|
||||
@@ -29,7 +29,7 @@ module.exports = new Event("interactionCreate", async (client, interaction) => {
|
||||
embeds: [NotValid],
|
||||
});
|
||||
|
||||
const permission = interaction.member.permissions.has(command.permission);
|
||||
const permission = interaction.member.permissions.has(command.permissions);
|
||||
|
||||
const ValidPerms = new Discord.MessageEmbed()
|
||||
.setDescription(
|
||||
@@ -41,11 +41,13 @@ module.exports = new Event("interactionCreate", async (client, interaction) => {
|
||||
return interaction.reply({
|
||||
embeds: [ValidPerms],
|
||||
});
|
||||
interaction.user = interaction.user;
|
||||
command.run(interaction);
|
||||
}
|
||||
if (interaction.isButton()) {
|
||||
if (interaction.customId === "openticket") {
|
||||
if (
|
||||
interaction.customId === "openticket" ||
|
||||
interaction.customId.includes("department-")
|
||||
) {
|
||||
try {
|
||||
const cmd = client.commands.get(cmdconfig.OpenTicket);
|
||||
if (!cmd) return;
|
||||
@@ -90,19 +92,22 @@ module.exports = new Event("interactionCreate", async (client, interaction) => {
|
||||
(c) => c.id === `${supportbot.LockTicketCategory}`
|
||||
);
|
||||
if (parent) {
|
||||
interaction.channel.setParent(parent.id);
|
||||
await interaction.channel.setParent(parent.id);
|
||||
}
|
||||
|
||||
all.forEach((perm) => {
|
||||
interaction.channel.permissionOverwrites.delete(perm.id);
|
||||
});
|
||||
interaction.channel.permissionOverwrites.create(Admin.id, {
|
||||
await interaction.channel.permissionOverwrites.create(Admin.id, {
|
||||
VIEW_CHANNEL: true,
|
||||
});
|
||||
|
||||
interaction.channel.permissionOverwrites.create(interaction.guild.id, {
|
||||
VIEW_CHANNEL: false,
|
||||
});
|
||||
await interaction.channel.permissionOverwrites.create(
|
||||
interaction.guild.id,
|
||||
{
|
||||
VIEW_CHANNEL: false,
|
||||
}
|
||||
);
|
||||
|
||||
const ticketDeleteButton = new Discord.MessageButton()
|
||||
.setCustomId("ticketclose")
|
||||
|
||||
@@ -5,7 +5,7 @@ class Command {
|
||||
constructor(options) {
|
||||
this.name = options.name;
|
||||
this.description = options.description;
|
||||
this.permissions = options.permissions;
|
||||
this.permissions = options.permissions || [];
|
||||
this.options = options.options || [];
|
||||
this.run = options.run;
|
||||
this.defaultPermission = true;
|
||||
|
||||
Reference in new issue
Block a user