eniagreen / botml

Powerful markup language for modern chatbots.
https://codename.co/botml
MIT License
101 stars 20 forks source link

Ability to load script manually #29

Closed esatterwhite closed 5 years ago

esatterwhite commented 5 years ago

It looks like it can only load from disk or urls.

Id really like to be able to generate the workflows from an application and load them into a bot directly


const Botml = require('botml')
const bot = new Botml()

bot.load(`
! BOTML 1

> Hello
< Hello human!
`.trim()
)
bot.start()
arnaud commented 5 years ago

You should be able to do just that using .parse() instead of .load():

const Botml = require('botml')
const bot = new Botml()

bot.parse(`
! BOTML 1

> Hello
< Hello human!
`.trim()
)
bot.start()
esatterwhite commented 5 years ago

Ah. Thanks!