UNPKG

goofy-cookie-cli

Version:

A goofy cookie-themed CLI for fun

39 lines (36 loc) 1.5 kB
const { printWithEmoji, colors } = require('../utils/print'); function handleEvilCookieJarCommands(input) { const [cmd, ...args] = input.toLowerCase().split(/\s+/); const userArg = args.find(a => a.startsWith("@")); const color = colors.red; switch (cmd + " " + (args[0] || "")) { case "cookie bonk": printWithEmoji(userArg ? `💢 Evil cookie bonks ${userArg} and shatters reality!` : "💢 Evil cookie bonks itself... ouch!", color); break; case "cookie throw": printWithEmoji(userArg ? `💥 Evil cookie throws a cookie at ${userArg}! Watch out!` : "💥 Evil cookie throws cookies everywhere!", color); break; case "cookie fight": printWithEmoji(userArg ? `🥊 Evil cookie fights fiercely with ${userArg}!` : "🥊 Evil cookie fights with itself... epic battle!", color); break; case "cookie angry": printWithEmoji(userArg ? `😠 Evil cookie is angry at ${userArg}. Crumbs fly!` : "😠 Evil cookie is furious... crumbs everywhere!", color); break; case "cookie jealous": printWithEmoji(userArg ? `😤 Evil cookie is jealous of ${userArg}. Beware!` : "😤 Evil cookie is jealous... silently seething.", color); break; default: printWithEmoji(`Unknown evil cookie jar command: "${input}". Try 'cookie help'.`, color); } } module.exports = { handleEvilCookieJarCommands };