Skip to content

Commit

Permalink
Added forgotten property, fixed docs a little
Browse files Browse the repository at this point in the history
  • Loading branch information
JustCat80 committed Jul 3, 2021
1 parent 583d31f commit d0bfd6e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/structures/Interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const Base = require("./Base");
const Message = require("./Message");
const Member = require("./Member");
const User = require("./User");
const Constants = require("../Constants");

/**
Expand All @@ -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<Object>?} 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)
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit d0bfd6e

Please sign in to comment.