-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
ModalSubmitInteraction.js
36 lines (29 loc) · 1.01 KB
/
ModalSubmitInteraction.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'use strict';
const BaseMessageComponent = require('./BaseMessageComponent');
const Interaction = require('./Interaction');
const InteractionResponses = require('./interfaces/InteractionResponses');
class ModalSubmitInteraction extends Interaction {
constructor(client, data) {
super(client, data);
/**
* The custom id of the modal.
* @type {string}
*/
this.customId = data.data.custom_id;
/**
* The inputs within the modal
* @type {Array<MessageActionRow<MessageActionRowComponent>>}
*/
this.components = data.data.components?.map(c => BaseMessageComponent.create(c, this.client)) ?? [];
}
// These are here only for documentation purposes - they are implemented by InteractionResponses
/* eslint-disable no-empty-function */
deferReply() {}
reply() {}
fetchReply() {}
editReply() {}
deleteReply() {}
followUp() {}
}
InteractionResponses.applyToClass(ModalSubmitInteraction, ['deferUpdate', 'update', 'presentModal']);
module.exports = ModalSubmitInteraction;