Build bots in JavaScript
script.mjs
file, as specified under the “main” property in the botspec.json
file. When your bot is executed it will look for an exported main
function in that file and call it.
The main
function can be asyncrounous (to let you use await inside) and recieves the three following arguments:
inputs
(object) - the inputs passed to your bot by the user.params
(object) - the parameters configured by the the user for your bot.accounts
(array) - an array containing all the requested account credentials for your bot to use.main
function will look like this: