#how to make a text menu
40 messages · Page 1 of 1 (latest)
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
🤷♂️
TextInputBuilder#setRequired()
Sets whether this text input is required
You could additionally use this
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
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.
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.
Interactions: Modals