import { array as randomElement } from './random'; export default function game8Ball( addResponses?: string[] | string, options?: { responses: string[] }, ): string { let array: string[] = [ 'Obviously not!', 'Sure!', 'I am not sure about that...', 'Probably in a few months...', 'Why the question?', 'I am 100% sure that it is so', 'I do not think so...', 'No...', 'Ask another time', 'Maybe...', "Sorry, it's not me you have to ask.", 'In the distant future yes...', "I don't want to answer that.", 'Yes! Well maybe.', 'Not for me, what do you say?', 'Of course, no...', '¡Yes! :D', "That's impossible.", 'I think I have a little lag, please try again later...', ]; if (options) array = options.responses; if (addResponses) typeof addResponses === 'string' ? array.push(addResponses) : addResponses.forEach((question) => array.push(question)); return randomElement(array); }