diff --git a/packages/create-robo/src/index.ts b/packages/create-robo/src/index.ts index b9303c26..a4452e92 100644 --- a/packages/create-robo/src/index.ts +++ b/packages/create-robo/src/index.ts @@ -41,7 +41,7 @@ new Command('create-robo ') .option('-v --verbose', 'print more information for debugging') .option('-rv, --robo-version ', 'specify a Robo.js version to use') .option('-k, --kit ', 'choose a kit to start off with your Robo') - .option('-nc, --no-creds ', 'Skips asking for the credentials', false) + .option('-nc --no-creds', 'Skips asking for the credentials') .action(async (options: CommandOptions, { args }) => { logger({ level: options.verbose ? 'debug' : 'info' @@ -165,8 +165,7 @@ new Command('create-robo ') // Ask the user for their Discord credentials (token and client ID) and store them for later use // Skip this step if the user is creating a plugin - // - if (!robo.isPlugin && options.noCreds) { + if (!robo.isPlugin) { logger.debug(`Asking for Discord credentials...`) await robo.askForDiscordCredentials() } diff --git a/packages/create-robo/src/robo.ts b/packages/create-robo/src/robo.ts index cc8d6d8a..2bb8f4c2 100644 --- a/packages/create-robo/src/robo.ts +++ b/packages/create-robo/src/robo.ts @@ -837,20 +837,25 @@ export default class Robo { const discordPortalUrl = chalk.bold.blue('https://discord.com/developers/applications') const officialGuide = 'Guide:' const officialGuideUrl = chalk.bold.blue('https://roboplay.dev/' + (this._isApp ? 'appkey' : 'botkey')) + + let discordClientId = '' + let discordToken = '' logger.log('') logger.log(Indent, chalk.bold('🔑 Setting up credentials')) logger.log(Indent, ' Get your credentials from the Discord Developer portal.\n') logger.log(Indent, ` ${discordPortal} ${discordPortalUrl}`) logger.log(Indent, ` ${officialGuide} ${officialGuideUrl}\n`) - const discordClientId = await input({ - message: 'Enter your Discord Client ID (press Enter to skip):' - }) - const discordToken = await input({ - message: this._isApp - ? 'Enter your Discord Client Secret (press enter to skip)' - : 'Enter your Discord Token (press Enter to skip):' - }) + if (this._cliOptions.creds) { + discordClientId = await input({ + message: 'Enter your Discord Client ID (press Enter to skip):' + }) + discordToken = await input({ + message: this._isApp + ? 'Enter your Discord Client Secret (press enter to skip)' + : 'Enter your Discord Token (press Enter to skip):' + }) + } if (!discordClientId || !discordToken) { this._missingEnv = true