From d0bfd6e212c287d0c10cbfaf1f70af674bc65c8b Mon Sep 17 00:00:00 2001 From: Canine8YT Date: Sat, 3 Jul 2021 03:32:12 -0500 Subject: [PATCH] Added forgotten property, fixed docs a little --- lib/structures/Interaction.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/structures/Interaction.js b/lib/structures/Interaction.js index f16a6cff5..9aeea826c 100644 --- a/lib/structures/Interaction.js +++ b/lib/structures/Interaction.js @@ -3,6 +3,7 @@ const Base = require("./Base"); const Message = require("./Message"); const Member = require("./Member"); +const User = require("./User"); const Constants = require("../Constants"); /** @@ -11,8 +12,8 @@ const Constants = require("../Constants"); * @prop {String?} channelId The interaction token * @prop {Object?} data The data attached to the interaction * @prop {Number?} data.componentType The type of Message Component (Message Component only) -* @prop {String?} data.id The ID of the Slash Command (Slash Command) * @prop {String?} data.custom_id The ID of the Button (Message Component) +* @prop {String?} data.id The ID of the Slash Command (Slash Command) * @prop {String?} data.name The command name (Slash Command only) * @prop {Array?} data.options The run Slash Command options (Slash Command only) * @prop {String?} data.options.name The name of the Slash Command option (Slash Command only) @@ -23,6 +24,7 @@ const Constants = require("../Constants"); * @prop {Message?} message The message the interaction came from (Message Component only) * @prop {String} token The interaction token (Interaction tokens are valid for 15 minutes and can be used to send followup messages but you must send an initial response within 3 seconds of receiving the event. If the 3 second deadline is exceeded, the token will be invalidated.) * @prop {Number} type 1 is a Ping, 2 is a Slash Command, 3 is a Message Component +* @prop {User?} user the user who triggered the interaction (This is only send when the interaction is invoked within a dm) * @prop {Number} version The interaction version */ class Interaction extends Base { @@ -56,6 +58,10 @@ class Interaction extends Base { this.token = data.token; } + if(data.user !== undefined) { + this.user = new User(data.user, this._client); + } + this.type = data.type; this.version = data.version; }