From de714b78ff61c6f17ec6cff22b94c3eb97568c67 Mon Sep 17 00:00:00 2001 From: murm Date: Fri, 17 Mar 2023 01:57:46 -0400 Subject: [PATCH] who needs application commands when you have SWAG --- classes/command.js | 51 ++++++++++++++++------------------------------ 1 file changed, 17 insertions(+), 34 deletions(-) diff --git a/classes/command.js b/classes/command.js index 3471e4c..afed164 100644 --- a/classes/command.js +++ b/classes/command.js @@ -5,41 +5,24 @@ class Command { this.origOptions = options; this.type = options.type; this.args = options.args; - if (options.type === "classic") { - this.message = options.message; - this.channel = options.message.room_id; - this.guild = options.message.guild; - this.author = options.message.sender; - this.member = options.message.member; - this.content = options.content; - this.options = options.specialArgs; - this.reference = { - messageReference: { - channelID: this.message.channelID, - messageID: this.message.id, - guildID: this.message.guildID ?? undefined, - failIfNotExists: false - }, - allowedMentions: { - repliedUser: false - } - }; - } else if (options.type === "application") { - this.interaction = options.interaction; - this.args = []; - this.channel = options.interaction.channel; - this.guild = options.interaction.guild; - this.author = this.member = options.interaction.guildID ? options.interaction.member : options.interaction.user; - if (options.interaction.data.options) { - this.options = options.interaction.data.options.raw.reduce((obj, item) => { - obj[item.name] = item.value; - return obj; - }, {}); - this.optionsArray = options.interaction.data.options.raw; - } else { - this.options = {}; + this.message = options.message; + this.channel = options.message.room_id; + this.guild = options.message.room_id; + this.author = options.message.sender; + this.member = options.message.member; + this.content = options.content; + this.options = options.specialArgs; + this.reference = { + messageReference: { + channelID: this.message.channelID, + messageID: this.message.id, + guildID: this.message.guildID ?? undefined, + failIfNotExists: false + }, + allowedMentions: { + repliedUser: false } - } + }; } async run() {