Botpress: Document using built-in content types

Created on 5 May 2018  路  6Comments  路  Source: botpress/botpress

Botpress

I'm going to write a bot for several platforms. From my point of view, I have to write a bot and run on different platforms but in general I have a few basic problems.

  • Each of the shipping platforms has a particular way to send messages
  • In the boot press, each module is generated based on the platform, and finally it should be written in code based on the platform code.

For example, when sending a message in a telegram, the following code should be written

const pickCategory = {
聽reply_markup: {
聽聽聽聽聽聽聽聽keyboard: [
聽聽聽聽聽聽聽聽聽聽['馃嵄 k2', '馃洜 k1'],
聽聽聽聽聽聽聽聽聽聽['馃洅 k3', '馃殯 k4'],
聽聽聽聽聽聽聽聽]
聽聽聽聽聽聽}
}
bp.telegram.sendText (event.chat.id, 'Hi' ,pickCategory);

And in Messenger Messenger, the following code is const pickCategory = {

const pickCategory = {
聽聽quick_replies: [
聽聽聽聽{
聽聽聽聽聽聽content_type: 'text',
聽聽聽聽聽聽title: '馃敟 Work 馃敟',
聽聽聽聽聽聽payload: 'GET_VIDEO_WORK'
聽聽聽聽},
聽聽聽聽{
聽聽聽聽聽聽content_type: 'text',
聽聽聽聽聽聽title: '馃槍 Life Goals 馃敟',
聽聽聽聽聽聽payload: 'GET_VIDEO_LIFE'
聽聽聽聽},
聽聽聽聽{
聽聽聽聽聽聽content_type: 'text',
聽聽聽聽聽聽title: '馃挭 Gym 馃敟',
聽聽聽聽聽聽payload: 'GET_VIDEO_GYM'
聽聽聽聽}
聽聽],
聽聽typing: true
}

bp.messenger.sendText (event.user.id, 'hi', pickCategory);

Well, what's the solution? Should not it be a standard for all platforms, so that when it's written and executed, it's just a setting that will be based on which bot is on?
聽Therefore, the code is written only once and it is called only once. What is the plan to do?

Most helpful comment

@azizkhani No documentation yet but working on it. Our plan is to release this with the initial public Botpress X release in the next couple days!

All 6 comments

@azizkhani The solution is Content Renderer. This is explained here: https://botpress.io/docs/beta/getting_started/trivia_content/

Content Renderer
A Content Renderer defines how a Content Type gets rendered on the different channels.

Note: This is critical because every channel is different and has a different set of functionalities. You want to be able to customize and leverage the features of the different platforms to offer the best user experience as possible.

@slvnperron
I suggest that botpress create a dsl for sending different message types. As we know, the messaging features on all platforms should not exceed 30. So just after creating this dsl, for each module written, a translator is written to convert the language created into the format of the platform.
Why this does not work with botpress. I think this can solve a lot of problems and transfer many of the complexities into modules.

@azizkhani Thanks for the siggestion, already in progress here: https://github.com/botpress/botpress/tree/sp-content/packages/core/botpress-builtins/src

@slvnperron is any documentation about this feature and other roadmap?
I will be happy to know what is your plan and can help your team in solve issues

@azizkhani No documentation yet but working on it. Our plan is to release this with the initial public Botpress X release in the next couple days!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

crixx picture crixx  路  6Comments

mhjb picture mhjb  路  3Comments

eyalcohen4 picture eyalcohen4  路  12Comments

Running-He picture Running-He  路  6Comments

crixx picture crixx  路  5Comments