botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
69 stars 83 forks source link

[Feature Request] View function arguments in UI #175

Closed slvnperron closed 6 years ago

slvnperron commented 6 years ago

It is currently very painful to have to go to the docs / code to recall what the parameters to a function is. It would be much better to have the different parameters (at least) hinted, and even better if the "required" parameters were actually inputed automatically.

image


This feature is partially done on the backend, you have the possibility to attach function definitions via the setFunctionMetadataProvider method in the DM.

I also built a prototype using JSDoc comments as Metadata which worked great.

var jsdoc = require('jsdoc-api')
// ...
jsdoc
  .explain({ files: [__dirname + '/functions.js'] })
  .then(docs => {
      // use setFunctionMetadataProvider
  })
epaminond commented 6 years ago

@slvnperron , how can I add functions?

slvnperron commented 6 years ago

@epaminond There :) https://github.com/botpress/botpress/blob/x/docs/docs/getting_started/trivia_actions.md