The different types of inputs and parameters bots can take on
Parameters | Inputs | |
---|---|---|
When Configured? | When the user installs the bot, and in the settings page. | Every time the user runs the bot. |
Purpose | General settings and configurations for the bot. | Task definition for the bot. |
botspec.json
file under the params
and inputs
fields respectively. As the structure for defining parameters and inputs is the same, the rest of this document will refer to both simulanously.
bostpect.json
using a JSON Schema object (with several custom extensions we will discuss below). The general structure for fields will look as following:
false
.
must match format "email"
, which is not very helpful.
string
type to accept a string value from the user. The following additional optional configurations are supported:
Property | Type | Description |
---|---|---|
placeholder | string | The placeholder text to show in the field when it’s empty. |
minLength | number | The minimum length of the string. |
maxLength | number | The maximum length of the string. |
pattern | string | A regular expression that the string must match. See more here. |
format | string | A format that the string must match. See here for a list of supported formats. |
enum | string[] | A list of possible values the string can take on. |
textarea | boolean | If true, the field will be rendered as a larger text area optimized for longer text inputs. |
boolean
type to accept a boolean value from the user. The field will be rendered as a toggle. Boolean types have no additional configurations.
number
type to accept a numeric value from the user. The following additional optional configurations are supported:
Property | Type | Description |
---|---|---|
placeholder | string | The placeholder text to show in the field when it’s empty. |
multipleOf | number | Numbers can be restricted to a multiple of a given number. It may be set to any positive number. |
minimum | number | The minimum value of the number. x ≥ minimum |
exclusiveMinimum | number | The minimum value of the number. x > exclusiveMinimum |
maximum | number | The maximum value of the number. x ≤ maximum |
exclusiveMaximum | number | The maximum value of the number. x < exclusiveMaximum |
enum | number[] | A list of possible values the number can take on. |
integer
type to accept an integer value from the user. The following additional optional configurations are supported:
Property | Type | Description |
---|---|---|
placeholder | string | The placeholder text to show in the field when it’s empty. |
multipleOf | number | Numbers can be restricted to a multiple of a given number. It may be set to any positive number. |
minimum | number | The minimum value of the number. x ≥ minimum |
exclusiveMinimum | number | The minimum value of the number. x > exclusiveMinimum |
maximum | number | The maximum value of the number. x ≤ maximum |
exclusiveMaximum | number | The maximum value of the number. x < exclusiveMaximum |
enum | number[] | A list of possible values the number can take on. |
file
type to accept a file as an input. The user will be able to choose a local file to be uploaded to the bot.
The bot runtime will recieve a signed URL where the file can be downloaded from. Note that the files are kept on the server for a limited time (currently 24 hours) and will be deleted after that time. Farthermore, the signedUrl for the file will only be valid for a limited time (roughly 30 minutes) for security reasons.
File inputs are thus not suitable for longer term storage of items, but only as a mechanism to transfer a file into the bot ephermally.
The following additional optional configurations are supported:
Property | Type | Description |
---|---|---|
accept | string | The type of files accepted as a comma seperated list of suffixes (.svg,.png,.mp3 ) or as a comma seperated list of MIME types (image/png,image/jpeg ). Wildcard MIME types are supported (image/* ), as well as mixing file suffixes and mime types. |
date
type to accept a date value from the user. The date will be passed to the bot as a string representing the date in ISO 8601 format.
array
type to accept an array of values from the user. The items
property defines the shape of each item - which can be a string, number or any of the other types of inputs mentioned above. The following additional optional configurations are supported:
Property | Type | Description |
---|---|---|
items | object | The schema for each item in the array. |
minItems | number | The minimum number of items in the array. |
maxItems | number | The maximum number of items in the array. |
uniqueItems | boolean | If true, all items in the array must be unique. |