const { Client, ModalSubmitInteraction, EmbedBuilder } = require("discord.js")
module.exports = {
name: "interactionCreate",
async execute(interaction, client) {
const { type, customId, channel, guild, user, fields } = interaction
if (type !== interaction.isModalSubmit) return
if (interaction.customId === 'profile-modal') {
const orientationInput = submission.fields.getTextInputValue('orientation-input');
const locationInput = submission.fields.getTextInputValue('location-input');
const aboutInput = submission.fields.getTextInputValue('about-input');
const channel = client.channels.cache.get('1034095095261184040');
console.log({ orientationInput, locationInput, aboutInput });
const Embed1 = new EmbedBuilder()
.setColor("blue")
.setTitle("orientation")
.setThumbnail(guild.iconURL())
.setDescription(orientationInput)
.setTimestamp()
const Embed2 = new EmbedBuilder()
.setColor("blue")
.setTitle("location")
.setThumbnail(guild.iconURL())
.setDescription(locationInput)
.setTimestamp()
const Embed3 = new EmbedBuilder()
.setColor("blue")
.setTitle("about")
.setThumbnail(guild.iconURL())
.setDescription(messageInput)
.setTimestamp()
const submission = await interaction.awaitModalSubmit({ time: 0 });
await submission.update({ embeds: [Embed1, Embed2, Embed3] });
}
}}
#Need help making this Modal submit. Can you?
1 messages · Page 1 of 1 (latest)
You're waiting 0 milliseconds for the modal to be submit, so that promise will always immediately reject
Otherwise, is there more context as to an actual error you're facing?
Yeah i changed that. Now am getting this error.
That error is pretty self-explanatory
Only use variables after you declare them
What do you mean?
.