BotCaptain Classes Overview

Overview of Classes and their methods

Context Handlers

class messageParser.onTurn(turnContext)

Main context handler for the bot.

TurnContext Parameters:

  • activity.channelId

  • activity.from.name

  • activity.from.id

Requires:

  • class fileIO

  • class jsonfile

  • class botbuilder.ActivityTypes

  • class botbuilder-dialogs

  • class EmailDialog(user)

  • class reminderDialog(user)

  • class taskDialog(user)

  • class xAPI_Statements

class messageLock.checkUser(userID)

Ensures only one user may initiate dialog at a time.

TurnContext Parameters:

*activity.context.UserID

Requires

  • class jsonfile

class scheduler.function(**kwargs)

Utility class that handles all scheduling functions for the bot.

Functions:

  • static email(address, date, time, message)

"date" argument must adhere to TimeEx format. Click here for more details on the format.

Requires:

  • class node-schedule

  • class nodemailer

  • module config

class channelValidation.validateChannel(turnContext)

Fixes channel specific errors

TurnContext Parameters:

  • activity.channelId

  • activity.text

Dialogs

class profileDialog.js(turnContext)

Sets up user profile upon first arrival.

TurnContext Parameters:

  • activity.from.name

  • activity.text

Returns user object.

Requires:

  • extends class ComponentDialog()

  • class WaterFallDialog(id, dialogs)

  • class TextPrompt(id, prompt

  • class ClassPrompt(promptID)

  • class TeamPrompt(promptID)

  • class EmailPrompt(promptID)

  • class NickPrompt(promptID)

class reminderDialog.js(turnContext)

Sets email reminders for tasks that are in team database.

TurnContext Parameters:

  • activity.from.name

  • activity.text

User Paramters

  • Profile.email

  • Profile.class

Returns:

  • Email schedule job

  • Values.schedule

  • xAPI Record to LRS if installed

Requires:

  • function scheduler.email(address, date, time, message)

  • extends class ComponentDialog()

  • class WaterFallDialog(id, dialogs)

  • class TextPrompt(id, prompt)

  • class TaskPrompt(promptID)

  • class DatePrompt(promptID)

  • class TimePrompt(promptID)

class taskDialog.js(turnContext)

Returns requested task description and due date in the channel.

TurnContext Parameters:

  • activity.from.name

  • activity.text

User Parameters

  • Profile.class

Returns:

  • Task Description and Due Date

  • xAPI Record to LRS if installed

Requires:

  • class TaskPrompt(promptID)

  • extends class ComponentDialog()

  • class WaterFallDialog(id, dialogs)

  • class TextPrompt(id, prompt)

Prompts make use of the "botbuilder-dialogs" documentation.