Skip to content

Commit

Permalink
Better docs + notes
Browse files Browse the repository at this point in the history
  • Loading branch information
JustCat80 committed Jun 10, 2021
1 parent 1e1ef48 commit f604f61
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions lib/structures/Interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class Interaction extends Base {
}

/**
* Note: You can **not** use more then 1 initial interaction response per interaction.
* Acknowledges the interaction without replying. (Message Component only)
* @returns {Promise}
*/
Expand Down Expand Up @@ -105,7 +106,8 @@ class Interaction extends Base {
}

/**
* Respond to the interaction with a message !use createFollowup if you have already responded with a different method
* Respond to the interaction with a message
* Note: You can **not** use more then 1 initial interaction response per interaction, use createFollowup if you have already responded with a different interaction response.
* @arg {String | Object} content A string or object. If an object is passed:
* @arg {Object} [content.allowedMentions] A list of mentions to allow (overrides default)
* @arg {Boolean} [content.allowedMentions.everyone] Whether or not to allow @everyone/@here.
Expand Down Expand Up @@ -140,6 +142,7 @@ class Interaction extends Base {

/**
* Defer response to the interaction
* Note: You can **not** use more then 1 initial interaction response per interaction.
* @arg {Boolean} [flags] 64 for Ephemeral
* @returns {Promise}
*/
Expand All @@ -154,6 +157,7 @@ class Interaction extends Base {

/**
* Defer message update (Message Component only)
* Note: You can **not** use more then 1 initial interaction response per interaction.
* @returns {Promise}
*/
async deferUpdate() {
Expand All @@ -163,7 +167,7 @@ class Interaction extends Base {
}

/**
* Delete a message !!Does nothing for some reason
* Delete a message
* @arg {String} messageId the id of the message to edit, or "@original" for the original response, "@original" will will error with ephemeral messages
* @returns {Promise}
*/
Expand All @@ -185,7 +189,7 @@ class Interaction extends Base {
* @arg {Object | Array<Object>} [options.file] A file object (or an Array of them)
* @arg {Buffer} options.file.file A buffer containing file data
* @arg {String} options.file.name What to name the file
* @returns {Promise}
* @returns {Promise<Message>}
*/
async edit(messageId, content) {
if(content !== undefined) {
Expand All @@ -206,8 +210,19 @@ class Interaction extends Base {
}

/**
* Edit the interaction Message !use edit if you have already responded with a different method (Message Component only)
* Edit the interaction Message
* Note: You can **not** use more then 1 initial interaction response per interaction, use edit if you have already responded with a different interaction response.
* @arg {String | Object} content What to edit the message with
* @arg {Object} [content.allowedMentions] A list of mentions to allow (overrides default)
* @arg {Boolean} [content.allowedMentions.everyone] Whether or not to allow @everyone/@here.
* @arg {Boolean | Array<String>} [content.allowedMentions.roles] Whether or not to allow all role mentions, or an array of specific role mentions to allow.
* @arg {Boolean | Array<String>} [content.allowedMentions.users] Whether or not to allow all user mentions, or an array of specific user mentions to allow.
* @arg {Boolean} [content.allowedMentions.repliedUser] Whether or not to mention the author of the message being replied to.
* @arg {String} [content.content=""] A content string
* @arg {Array<Object>} [content.embeds] An array of Discord embeds
* @arg {Object | Array<Object>} [content.file] A file object (or an Array of them)
* @arg {Buffer} content.file.file A buffer containing file data
* @arg {String} content.file.name What to name the file
* @returns {Promise}
*/
async editParent(content) {
Expand Down

0 comments on commit f604f61

Please sign in to comment.