Skip to content

Instantly share code, notes, and snippets.

@Jlawlzz
Last active April 28, 2017 22:24
Show Gist options
  • Save Jlawlzz/a6681293d920f84f3ad16ca4a004452e to your computer and use it in GitHub Desktop.
Save Jlawlzz/a6681293d920f84f3ad16ca4a004452e to your computer and use it in GitHub Desktop.

So if the incident metadata is blank, just pass in an empty object: {}.

The bot will create the state from scratch as if it was starting a new conversation.

On output the bot will pass an object:

{
  outgoing_payloads: outgoing_payloads,
  state: {
    version: @state.version,
    data: @state.data,
    history: @state.history
  },
  action: @state.action
}

outgoing_payloads and action are for your use. state is to be updated as as the metadata blob.

To initiate: bot = Engine.new(metadata, message)

To recieve the return object: bot.process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment