I am currently trying to work on a project where I can get collector to collect user input and load it to my template and shows me to verify it before sending.
Format is : This if template format I want currently trying to collect user input for
I am currently trying to work on a project where I can get collector to collect user input and load it to my template and shows me to verify it before sending.
Format is : This if template format I want currently trying to collect user input for
I'm not going to write all your code for you, but I can definitely point you in the right direction! What you're probably looking for is the string split function. This lets you take an input string and turn it into an array. For example, the string hello, this is a test, I think?
could be split on the ,
character, and the result would be ["hello", "this is a test", "I think?"]
. In your case, this can be used to take the user's message, and split it into the template parts you need. Then you can just iterate through the resulting array and add each part to the correct spot in the template!
As for verifying the message before sending, there's a ton of ways that can be accomplished. One way just off the top of my head is that you can send the message to a private verification channel, then use a reaction collector to verify or deny it. If it's verified, you can set the bot to send the message wherever.
I would recommend reading over discordjs.guide. That site has an incredibly large amount of useful information/code that will be able to help you with pretty much anything you could need!