Jordan
Jordan
DIAdiscord.js - Imagine an app
Created by Deerlo on 7/5/2023 in #djs-questions
messages
Yes
21 replies
DIAdiscord.js - Imagine an app
Created by Jordan on 6/24/2022 in #djs-questions
Error when submitting modal
const {MessageActionRow, Modal, MessageEmbed, TextInputComponent} = require('discord.js')

module.exports = async function(interaction){
if(interaction.isModalSubmit()) return m(interaction)
if(!interaction.isButton()) return
if(interaction.customId !== 'reply') return

const modal = new Modal()
.setCustomId('reply')
.setTitle('Respond to Case')

const content = new TextInputComponent()
.setCustomId('con')
.setLabel('Content')
.setStyle('PARAGRAPH')
.setMinLength(3)
.setMaxLength(2000)

const f = new MessageActionRow().addComponents(content);
modal.addComponents(f)

await interaction.showModal(modal)
await interaction.awaitModalSubmit({time: 1000})
}

function m(interaction){
if(interaction.commandId !== 'reply') return

var content = interaction.fields.getTextInputValue('con')
interaction.reply('ok')
}
const {MessageActionRow, Modal, MessageEmbed, TextInputComponent} = require('discord.js')

module.exports = async function(interaction){
if(interaction.isModalSubmit()) return m(interaction)
if(!interaction.isButton()) return
if(interaction.customId !== 'reply') return

const modal = new Modal()
.setCustomId('reply')
.setTitle('Respond to Case')

const content = new TextInputComponent()
.setCustomId('con')
.setLabel('Content')
.setStyle('PARAGRAPH')
.setMinLength(3)
.setMaxLength(2000)

const f = new MessageActionRow().addComponents(content);
modal.addComponents(f)

await interaction.showModal(modal)
await interaction.awaitModalSubmit({time: 1000})
}

function m(interaction){
if(interaction.commandId !== 'reply') return

var content = interaction.fields.getTextInputValue('con')
interaction.reply('ok')
}
This is as far as I got but idk what else i would havbe to do
16 replies
DIAdiscord.js - Imagine an app
Created by Jordan on 6/24/2022 in #djs-questions
Error when submitting modal
the function was to differentiate the button and modal interaction without switching to another file because they both are for the same overall function
16 replies
DIAdiscord.js - Imagine an app
Created by Jordan on 6/24/2022 in #djs-questions
Error when submitting modal
I will test it and archive this if it works
16 replies
DIAdiscord.js - Imagine an app
Created by Jordan on 6/24/2022 in #djs-questions
Error when submitting modal
Thank you both
16 replies
DIAdiscord.js - Imagine an app
Created by Jordan on 6/24/2022 in #djs-questions
Error when submitting modal
will i need to remove the m() function)?
16 replies
DIAdiscord.js - Imagine an app
Created by Jordan on 6/24/2022 in #djs-questions
Error when submitting modal
okay so something like
await awaitModalSubmit()
await awaitModalSubmit()
?
16 replies
DIAdiscord.js - Imagine an app
Created by Jordan on 6/24/2022 in #djs-questions
Error when submitting modal
const {MessageActionRow, Modal, MessageEmbed, TextInputComponent} = require('discord.js')

module.exports = async function(interaction){
if(interaction.isModalSubmit()) return m(interaction)
if(!interaction.isButton()) return
if(interaction.customId !== 'reply') return

const modal = new Modal()
.setCustomId('reply')
.setTitle('Respond to Case')

const content = new TextInputComponent()
.setCustomId('con')
.setLabel('Content')
.setStyle('PARAGRAPH')
.setMinLength(3)
.setMaxLength(2000)

const f = new MessageActionRow().addComponents(content);
modal.addComponents(f)

await interaction.showModal(modal)
}

function m(interaction){
if(interaction.commandId !== 'reply') return

var content = interaction.fields.getTextInputValue('con')
interaction.reply('ok')
}
const {MessageActionRow, Modal, MessageEmbed, TextInputComponent} = require('discord.js')

module.exports = async function(interaction){
if(interaction.isModalSubmit()) return m(interaction)
if(!interaction.isButton()) return
if(interaction.customId !== 'reply') return

const modal = new Modal()
.setCustomId('reply')
.setTitle('Respond to Case')

const content = new TextInputComponent()
.setCustomId('con')
.setLabel('Content')
.setStyle('PARAGRAPH')
.setMinLength(3)
.setMaxLength(2000)

const f = new MessageActionRow().addComponents(content);
modal.addComponents(f)

await interaction.showModal(modal)
}

function m(interaction){
if(interaction.commandId !== 'reply') return

var content = interaction.fields.getTextInputValue('con')
interaction.reply('ok')
}
16 replies
DIAdiscord.js - Imagine an app
Created by Jordan on 6/24/2022 in #djs-questions
Error when submitting modal
I added interaction.reply('ok") and tried it again but ti still failed
16 replies
DIAdiscord.js - Imagine an app
Created by Jordan on 6/21/2022 in #djs-questions
Fetching Messages from Discord's API
Alright, thank you I figured it wasn't possible but I still wanted to check because that would be cool (and a little bit of a security concern as well)
4 replies