async function startGame()

in chat-bot/bot/bot.js [55:76]


async function startGame(intentRequest) {
    // Start of the game
    const sessionAttributes = {
        started: true,
        currentQuestion: 1,
        currentSlot: "one",
        currentScore: 0,
    };

    const firstQuestion = await getQuestion(1);

    var message = {
        contentType: 'PlainText',
        content: "Let's play re:Invent Trivia! " +
            "The game covers four categories with four questions each. " +
            `Starting with the "${firstQuestion.data.category}" category, ` +
            `for ${firstQuestion.data.points} points: ${firstQuestion.data.question}`
    };

    return elicitSlot(sessionAttributes, intentRequest.currentIntent.name,
        intentRequest.currentIntent.slots, "one", message);
}