botpress / v12

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

[FEATURE] Upload Content #1678

Closed DigiSenseiZimbabwe closed 1 year ago

DigiSenseiZimbabwe commented 2 years ago

Description. I can send file to a user (yipee!) but the reverse is true only if I use BOTPRESS.FILE_UPLOAD or BOTPRESS.IMAGE_UPLOAD.

Solution My bot should be able to store images/files which I receive. "... for starters, display them in hitl/(next) - e.g Its annoying for the gu(rl)y monitoring chats to jump to FB inbox to view... "... rename them to something either designer defined or logical (like userId or a variable that can link to user).

Working Alternative For this to work on channels either than web you need to add a hook which detects the incoming content format ("payload":{"type":"text"} in events) then redirects to a node with BOTPRESS.FILE_UPLOAD.

This node has to be on the web channel which means a link with a single, single choice (or two if you want to use IMAGE_UPLOAD which is repetition because FILE works for images too).

After getting the file (if the user doesn't freak out and close the page) you then delegate to the channel bot (but your user has to be clever enough to close the webchat of your 'one trick pony' bot and resume their conversation on the channel or you can further annoy them by telling them to close the page.

On web you cannot do a hook because the chat interface does not allow the user to send any form of file out-of-the-box in the first place. So you need to...

I'm sure you can see where I am going with this and if you can't, its south.

Additional Context Just thinking, wouldn't it be nice to tell folks that they can code an upload out of the box without having to break their backs?

davidvitora commented 1 year ago

@DigiSenseiZimbabwe You can configure an AWS bucket in the web-channel to store your images.