terkelg/prompts

Can't seem to create a prompt with a Discord ID

Closed this issue · 0 comments

Describe the bug

I'm working on a script as part of a larger project that will allow the developer to generate test data for working on improving existing features and adding new ones.

The issue is, for some reason, I'm trying to get this script to include a Discord ID, but whether I choose type "text" or type "number", prompts kicks out its own internal error telling me to "Please Provide A Valid Value."

To Reproduce

Steps to reproduce the behavior:

  1. Create a prompt as follows:
import prompts from "prompts";

(async () => {
    const response = await prompts([
        {
            type: "text",
            name: "discordId",
            message: "Enter your Discord ID.",
        },
    ]);
    console.log(response); // Should output { discordId: "...etc" }
})();
  1. Enter a valid Discord ID (usually a sequence of 18 numbers).
  2. You should see the issue where it says "Please Enter A Valid Value."

image

Expected behavior

I expected this to work absolutely fine, with no issues, but instead this error occurs.

System

  • OS: Manjaro Linux
  • Terminal: bash
  • Node version: v20.13.0