Mateo-tem / discord-modals

discord-modals is a package that allows your bot of discord.js v13 to create the new Discord Modals and interact with them.
https://www.npmjs.com/package/discord-modals
MIT License
92 stars 28 forks source link

No ephemerals upon modal submit #78

Closed StephenL13 closed 2 years ago

StephenL13 commented 2 years ago

Greetings. Currently, I'm attempting to create modals for my server's verification gate system. However, I'm having technical problems whenever I want to notify the user privately once they submit the answers through the modal. Right now, I ran the interaction command at a private admin channel. Is there any further way to resolve this? Thank you.

Portion of code: image

Slash command image

Screenshot: image

Mateo-tem commented 2 years ago

Modal Submit Interactions don't support a directly ephemeral reply.

Mateo-tem commented 2 years ago

Take the example from the readme:

const { Formatters } = require('discord.js');

client.on('modalSubmit', async (modal) => {
  if(modal.customId === 'modal-customid'){
    const firstResponse = modal.getTextInputValue('textinput-customid')
    await modal.deferReply({ ephemeral: true })
    modal.followUp({ content: 'Congrats! Powered by discord-modals.' + Formatters.codeBlock('markdown', firstResponse), ephemeral: true })
  }  
});
StephenL13 commented 2 years ago

Sorry for the late reply, but thanks for this. Will look forward somehow to fix this on my end.