scure-dialogflow
Version:
Javascript engine for creating conversational adventures with Dialogflow / GoogleAssistant through SCURE
16 lines (13 loc) • 602 B
JavaScript
const { look, pickup, use, walk } = require('../intents');
const { Commands } = require('scure').dsl;
const INTENT_COMMANDS_MAP = new Map([
[],
[],
[],
[],
]);
const byCommand = command => intent => INTENT_COMMANDS_MAP.get(intent) === command;
const getCommandForIntent = intent => INTENT_COMMANDS_MAP.get(intent);
const getIntentForCommand = command => [...INTENT_COMMANDS_MAP.keys()].find(byCommand(command));
exports.getCommandForIntent = getCommandForIntent;
exports.getIntentForCommand = getIntentForCommand;