bot-handoff
Version:
Bot hand off module for the Microsoft Bot Framework. It allows you to transfer a customer from talking to a bot to talking to a human.
21 lines (16 loc) • 579 B
text/typescript
import { IAddress, IMessage, Message } from 'botbuilder';
export enum MessageSource {
Bot = 'Bot',
Agent = 'Agent',
Customer = 'Customer'
}
export interface IHandoffMessage extends IMessage {
customerAddress?: IAddress;
agentAddress?: IAddress;
}
export function addCustomerAddressToMessage(msg: IMessage, customerAddress: IAddress): void {
(msg as IHandoffMessage).customerAddress = customerAddress;
}
export function addAgentAddressToMessage(msg: IMessage, agentAddress: IAddress): void {
(msg as IHandoffMessage).agentAddress = agentAddress;
}