UNPKG

@aws-amplify/interactions

Version:

Interactions category of aws-amplify

19 lines (17 loc) 857 B
'use strict'; // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 Object.defineProperty(exports, "__esModule", { value: true }); exports.send = send; const utils_1 = require("@aws-amplify/core/internals/utils"); const utils_2 = require("../utils"); const AWSLexProvider_1 = require("../AWSLexProvider"); const errors_1 = require("../../errors"); async function send(...args) { const [ctx, input] = (0, utils_1.resolveCtxArgs)(args); const { botName, message } = input; const botConfig = (0, utils_2.resolveBotConfig)(ctx, botName); (0, errors_1.assertValidationError)(!!botConfig, errors_1.InteractionsValidationErrorCode.NoBotConfig, `Bot ${botName} does not exist.`); return AWSLexProvider_1.lexProvider.sendMessage(ctx, botConfig, message); } //# sourceMappingURL=send.js.map