constatic
Version:
Constatic cli
2 lines (1 loc) • 775 B
JavaScript
import{uiMessage as o}from"#helpers";import{withDefaults as a}from"#prompts";import{fetchDiscordTokenData as p}from"#shared/tokens.js";import{password as c}from"@inquirer/prompts";import s from"chalk";async function l(n){const t=await c(a({message:o({"en-US":"Insert your discord bot token","pt-BR":"Insira seu token de bot de discord"}),validate(e){const i=o({"en-US":"You need to provide the token for your bot application.","pt-BR":"\xC9 necess\xE1rio informar o token da sua aplica\xE7\xE3o de bot"});return e?!0:i}})),r=n.find(e=>e.token===t);if(r){const e=`\u{1F916} ${s.yellow.underline(r.name)}`;return{success:!1,error:o({"en-US":`This token is already saved! ${e}`,"pt-BR":`Este token j\xE1 est\xE1 salvo! ${e}`},s.red)}}return await p(t)}export{l as promptToken};