Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1747 from sassafrastech/i18n-support
Browse files Browse the repository at this point in the history
Support i18n via 'text' functions
  • Loading branch information
benbrown authored Oct 28, 2019
2 parents a4b54e7 + 3cc9bc4 commit 8504e69
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/botkit/src/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,11 @@ export class BotkitConversation<O extends object = {}> extends Dialog<O> {
let outgoing;
let text = '';

// If text is a function, call the function to get the actual text value.
if (typeof line.text === 'function') {
text = await line.text(vars);
}

// if the text is just a string, use it.
// otherwise, if it is an array, pick a random element
if (line.text && typeof(line.text)=='string') {
Expand Down

0 comments on commit 8504e69

Please sign in to comment.