botpress / v12

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

feat(channel-web): allow usage of contentElement for fileUpload message #1769

Closed davidvitora closed 9 months ago

davidvitora commented 9 months ago

Adds a channel-web module configuration variable "uploadsFileUploadedTextContentElement" that allows specifying a text content element to be rendered and sent to the user after a file upload (by default, it sends "Uploaded a file originalName")

OBS: Only set it on the bot-scoped channel-web configuration since content element IDs are specific for each bot (right-click on the global config file and 'Duplicate to current bot').

image

To use, create a builtin_text content element:

image

After, get the content element id, for example: "#!builtin_text-OzpN5X" (only builtin_text contentElements are supported)

Variables available:

storage: 'local' or 's3' url: URL where the file has been uploaded originalName: Name that the file had on the user's computer mime: mime type of the file, example: 'image/gif' size: size from the file in bytes

User variables are also available at 'event.state.user' (only user variables are supported)

image

Content Element Multilanguage is also supported:

image