#how to make a text menu

40 messages · Page 1 of 1 (latest)

woven granite
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

dusky ridgeBOT
pliant coyote
#

oh

#

@fierce inlet

#

That was v14 guide

#

Add at least one component

#

A text input

#

addComponents

#

Reply to the interaction

#

interactionCreate

#

you need it to reply to modals

#

Right there it just responds to slash commands

#

sounds like you're nesting listeners

#

the listener should not be set in any other listener

#

👍

#

#869652447881207858

#

use fs

#

you can't disable the submit button

#

but you can respond without doing anything

#

🤷‍♂️

dusky ridgeBOT
pliant coyote
#

So, did it work

#

Did you need it to be an array, instead of \n

#

so an array

#

Use string.split()

#

It will return the exact array you want

#

splits the string

#

to an array

#

.split("\n") should work here

#

.replace

#

or replaceAll

#

you should read the mdn docs

dusky ridgeBOT
#

mdn String.prototype.replaceAll()
The replaceAll() method returns a new string with all matches of a pattern replaced by a replacement. The pattern can be a string or a RegExp, and the replacement can be a string or a function to be called for each match. The original string is left unchanged.

#

mdn String.prototype.replace()
The replace() method returns a new string with one, some, or all matches of a pattern replaced by a replacement. The pattern can be a string or a RegExp, and the replacement can be a string or a function called for each match. If pattern is a string, only the first occurrence will be replaced. The original string is left unchanged.

pliant coyote
#

👍

#

This should be asked in #869652447881207858

#

I saw people trying to help you in #869652447881207858