xutilities-cli
Version:
A Command-Line Interface Tool For xUtilities (An Unblocked Games, Apps, & More Website Used When Bored At Work Or School) Used In-Case xUtilities On The Web Is Blocked/Banned.
54 lines (47 loc) • 1.65 kB
JavaScript
import inquirer from 'inquirer';
import chalk from 'chalk';
import { startConversation } from '../src/chatbot.js';
import { connectToChatroom } from '../src/chatroom.js';
import { showLinks } from '../src/links.js';
const ASCII_ART = `
__ ___ _ _______ _____ _ _____ _______ _____ ______ _____ _____ _ _____
\\ \\ / / | | |__ __|_ _| | |_ _|__ __|_ _| ____|/ ____| / ____| | |_ _|
\\ V /| | | | | | | | | | | | | | | | | |__ | (___ | | | | | |
> < | | | | | | | | | | | | | | | | | __| \\___ \\ | | | | | |
/ . \\| |__| | | | _| |_| |____ _| |_ | | _| |_| |____ ____) | | |____| |____ _| |_
/_/ \\_\\\\____/ |_| |_____|______|_____| |_| |_____|______|_____/ \\_____|______|_____|
`;
async function mainMenu() {
console.clear();
console.log(chalk.blue.bold(ASCII_ART));
console.log(chalk.blue.bold('Welcome to the xUtilities CLI.'));
const { choice } = await inquirer.prompt({
type: 'list',
name: 'choice',
message: 'What would you like to do?',
choices: [
{ name: 'Chatbot', value: 'chatbot' },
{ name: 'Chatroom', value: 'chatroom' },
{ name: 'Links', value: 'links' },
{ name: '\nExit', value: 'exit' }
]
});
switch(choice) {
case 'chatbot':
await startConversation();
break;
case 'chatroom':
await connectToChatroom();
break;
case 'links':
await showLinks();
break;
case 'exit':
default:
console.log(chalk.yellow('\nGoodbye!'));
process.exit(0);
}
mainMenu();
}
mainMenu();