diff --git a/Commands/add.js b/Commands/add.js index 3629b83..1a3d65a 100644 --- a/Commands/add.js +++ b/Commands/add.js @@ -15,7 +15,7 @@ const Command = require("../Structures/Command.js"); module.exports = new Command({ name: cmdconfig.TicketAdd, description: cmdconfig.TicketAddDesc, - slashCommandOptions: [ + options: [ { name: "user", description: "User to add", @@ -23,7 +23,7 @@ module.exports = new Command({ required: true, }, ], - permission: "SEND_MESSAGES", + permissions: ["SEND_MESSAGES"], async run(interaction) { const { getRole, getChannel, getCategory } = interaction.client; diff --git a/Commands/close.js b/Commands/close.js index 0c2b724..c7f7c67 100644 --- a/Commands/close.js +++ b/Commands/close.js @@ -15,14 +15,14 @@ const Command = require("../Structures/Command.js"); module.exports = new Command({ name: cmdconfig.CloseTicket, description: cmdconfig.CloseTicketDesc, - slashCommandOptions: [ + options: [ { name: "reason", description: "Ticket Close Reason", type: "STRING", }, ], - permission: "SEND_MESSAGES", + permissions: ["SEND_MESSAGES"], async run(interaction) { const { getRole, getChannel, getCategory } = interaction.client; diff --git a/Commands/embed.js b/Commands/embed.js index 62aeaf1..c9083ff 100644 --- a/Commands/embed.js +++ b/Commands/embed.js @@ -15,7 +15,7 @@ const Command = require("../Structures/Command.js"); module.exports = new Command({ name: cmdconfig.EmbedCommand, description: cmdconfig.EmbedCommandDesc, - slashCommandOptions: [ + options: [ { name: "title", description: "Embed Title", @@ -28,7 +28,7 @@ module.exports = new Command({ type: "STRING", }, ], - permission: "SEND_MESSAGES", + permissions: ["SEND_MESSAGES"], async run(interaction) { const { getRole, getChannel, getCategory } = interaction.client; diff --git a/Commands/help.js b/Commands/help.js index 9de6870..9b3e595 100644 --- a/Commands/help.js +++ b/Commands/help.js @@ -21,8 +21,8 @@ async function asyncForEach(array, callback) { module.exports = new Command({ name: cmdconfig.HelpCommand, description: cmdconfig.HelpCommandDesc, - slashCommandOptions: [], - permission: "SEND_MESSAGES", + options: [], + permissions: ["SEND_MESSAGES"], async run(interaction) { const { getRole, getChannel, getCategory } = interaction.client; diff --git a/Commands/info.js b/Commands/info.js index b93dcf9..51ad789 100644 --- a/Commands/info.js +++ b/Commands/info.js @@ -15,8 +15,8 @@ const Command = require("../Structures/Command.js"); module.exports = new Command({ name: cmdconfig.InfoCommand, description: cmdconfig.InfoCommandDesc, - slashCommandOptions: [], - permission: "SEND_MESSAGES", + options: [], + permissions: ["SEND_MESSAGES"], async run(interaction) { const InfoButton = new Discord.MessageButton() diff --git a/Commands/ping.js b/Commands/ping.js index edf812d..74637bb 100644 --- a/Commands/ping.js +++ b/Commands/ping.js @@ -15,8 +15,8 @@ const Command = require("../Structures/Command.js"); module.exports = new Command({ name: cmdconfig.PingCommand, description: cmdconfig.PingCommandDesc, - slashCommandOptions: [], - permission: "SEND_MESSAGES", + options: [], + permissions: ["SEND_MESSAGES"], async run(interaction) { const PingEmbed = new Discord.MessageEmbed() diff --git a/Commands/remove.js b/Commands/remove.js index 14c17b9..def341c 100644 --- a/Commands/remove.js +++ b/Commands/remove.js @@ -21,7 +21,7 @@ async function asyncForEach(array, callback) { module.exports = new Command({ name: cmdconfig.TicketRemove, description: cmdconfig.TicketRemoveDesc, - slashCommandOptions: [ + options: [ { name: "user", description: "User to remove", @@ -29,7 +29,7 @@ module.exports = new Command({ required: true, }, ], - permission: "SEND_MESSAGES", + permissions: ["SEND_MESSAGES"], async run(interaction) { const { getRole, getChannel, getCategory } = interaction.client; diff --git a/Commands/suggest.js b/Commands/suggest.js index 5182999..e29ac30 100644 --- a/Commands/suggest.js +++ b/Commands/suggest.js @@ -15,14 +15,14 @@ const Command = require("../Structures/Command.js"); module.exports = new Command({ name: cmdconfig.SuggestCommand, description: cmdconfig.SuggestCommandDesc, - slashCommandOptions: [ + options: [ { name: "suggestion", description: "Create a Suggestion", type: "STRING", }, ], - permission: "SEND_MESSAGES", + permissions: ["SEND_MESSAGES"], async run(interaction) { const { getRole, getChannel, getCategory } = interaction.client; diff --git a/Commands/ticket.js b/Commands/ticket.js index 384fa00..03a9289 100644 --- a/Commands/ticket.js +++ b/Commands/ticket.js @@ -21,14 +21,14 @@ const TicketNumberID = require("../Structures/TicketID.js"); module.exports = new Command({ name: cmdconfig.OpenTicket, description: cmdconfig.OpenTicketDesc, - slashCommandOptions: [ + options: [ { name: "reason", description: "Ticket Reason", type: "STRING", }, ], - permission: "SEND_MESSAGES", + permissions: ["SEND_MESSAGES"], async run(interaction) { const { getRole, getChannel, getCategory } = interaction.client; diff --git a/Structures/Command.js b/Structures/Command.js index ba663b5..1dfaffe 100644 --- a/Structures/Command.js +++ b/Structures/Command.js @@ -3,22 +3,16 @@ const fs = require("fs"); -const Discord = require("discord.js"); - const yaml = require("js-yaml"); -const supportbot = yaml.load( - fs.readFileSync("./Configs/supportbot.yml", "utf8") -); - -function RunFunction(interaction) {} class Command { constructor(options) { this.name = options.name; this.description = options.description; - this.permission = options.permission; - this.slashCommandOptions = options.slashCommandOptions || []; + this.permissions = options.permissions; + this.options = options.options || []; this.run = options.run; + this.defaultPermission = true; } }