Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

Custom Modules ⚡ supercharges ⚡ your Botpress chatbot building experience by adding in-chat capabilities and by customizing the chatbot editor to your liking.

This Github template is meant as the starting point for building Botpress Custom Modules. You can find a non-exhaustive use-case list [here](#how-do-i-do-xyz?) as well as lots of references below.
This GitHub template is meant as the starting point for building Botpress Custom Modules. You can find a non-exhaustive use-case list in [How do I do XYZ?](#how-do-i-do-xyz?) as well as lots of references below.

## Quick Start

1. Click "Use this template" at the top of the Github repo or fork this repo.
1. Click "Use this template" at the top of the GitHub repo or fork this repo.
2. Make your changes in the code. See [How do I do XYZ?](#how-do-i-do-xyz?)
3. To rename the package, change the folder name, the name field in [src/backend/index.ts](src/backend/index.ts) and the name field in [src/backend/index.ts](src/backend/index.ts)
4. Build using ``npm run dockerBuild``. The build will be named "YOUR_PACKAGE_NAME.tgz" and be located in the root folder.
Expand All @@ -18,30 +18,30 @@ This Github template is meant as the starting point for building Botpress Custom
9. In the modules page, click unpack now next to your module's name. ![](3.png)
10. Go back up to the list of Stable modules, and activate it by clicking the toggle next to the module's name. ![](4.png)
11. Start editing a chatbot. notice the flag icon for the custom module.
12. When you change your code, restart from from step 7.
12. When you change your code, restart from step 7.


## (Advanced) Where's Hot Reload?
Botpress doesn't currently support hot reload for custom module development. If you want to make changes and check them often, we recommend you clone the main repo and follow the instructions found [here](https://botpress.com/docs/building-chatbots/developers/custom-modules#local-development-tips). Changes will be reflected upon restarting the botpress server.
Botpress doesn't currently support hot reload for custom module development. If you want to make changes and check them often, we recommend you clone the main repo and follow the [Local Development Tips (Internet Archive link)](https://web.archive.org/web/20220706031741/https://botpress.com/docs/building-chatbots/developers/custom-modules#local-development-tips). Changes will be reflected upon restarting the Botpress server.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were a whole bunch of links in this document to a page that doesn't appear to exist anymore in the docs system (I searched).

I'm not seriously suggesting using Internet Archive Links. This is basically a "fix me" for @adkah


Generally speaking :
1) Clone the main repo. ``git clone https://github.com/botpress/botpress.git``
2) run ``yarn && yarn build`` in the main repo path.
3) follow ["Module Templates"](https://botpress.com/docs/building-chatbots/developers/custom-modules#module-templates)
4) Follow ["Local Development Tips"](https://botpress.com/docs/building-chatbots/developers/custom-modules#local-development-tips)
3) follow ["Module Templates"](https://web.archive.org/web/20220706031741/https://botpress.com/docs/building-chatbots/developers/custom-modules#module-templates)
4) Follow ["Local Development Tips"](https://web.archive.org/web/20220706031741/https://botpress.com/docs/building-chatbots/developers/custom-modules#local-development-tips)
5) Use the command ``yarn start`` to start the Botpress server.
6) To see changes, cancel the previous command, and use it again to restart the Botpress server and refresh your browser.

## How do I do XYZ?

Here is a non-exhaustive list of things you can do with custom modules.
This is a non-exhaustive list of things you can do with custom modules:

- To add Hooks / middleware : read [this](src/hooks/README.md)
- To add reusible code / actions : read [this](src/actions/README.md)
- To add new skills to the flow editor like a datepicker : inject them [here](src/backend/index.ts) - docs [here](https://botpress.com/docs/building-chatbots/developers/custom-modules#skills)
- To create bot templates for creating new bots : add them [here](src/bot-templates/) - docs [here](https://botpress.com/docs/building-chatbots/developers/custom-modules#bottemplates)
- To create content types to be sent to your users : add them [here](src/views/lite/)
- To create a navigation page within botpress : add them [here](src/views/full/index.jsx)
- To add Hooks / middleware : read the [hooks README](src/hooks/README.md)
- To add reusable code / actions : read [actions README](src/actions/README.md)
- To add new [skills (Internet Archive link)](https://web.archive.org/web/20220706031741/https://botpress.com/docs/building-chatbots/developers/custom-modules#skills) to the flow editor like a datepicker : inject them into [`index.ts`](src/backend/index.ts)
- To create [bot templates (Internet Archive link)](https://web.archive.org/web/20220706031741/https://botpress.com/docs/building-chatbots/developers/custom-modules#bottemplates) for creating new bots : add them to [`src/bot-templates/`](src/bot-templates/)
- To create content types to be sent to your users : add them to [`src/views/lite/`](src/views/lite/)
- To create a navigation page within Botpress : add them to [`src/views/full/index.jsx`](src/views/full/index.jsx)


## Docs and Reference
Expand All @@ -50,7 +50,7 @@ Pro tip :
The bot making experience is smoother than the custom module building experience. If you can, make your changes in a Botpress Bot, then migrate the changes to your custom module code.

### Documentation
[Botpress Official Docs](https://botpress.com/docs/building-chatbots/developers/custom-modules)
[Botpress Official Docs](https://web.archive.org/web/20220706031741/https://botpress.com/docs/building-chatbots/developers/custom-modules)

### Unofficial Video Series
1) [Module Structure](https://share.descript.com/view/F7HWNQVbpEX)
Expand All @@ -62,4 +62,4 @@ The bot making experience is smoother than the custom module building experience
7) [Bot Templates](https://share.descript.com/view/b6OAuV8C86E)

### Example Custom Modules
[Botpress Solutions Github Repo](https://github.com/botpress/solutions/tree/master/custom%20modules)
[Botpress Solutions GitHub Repo](https://github.com/botpress/solutions/tree/master/custom%20modules)
2 changes: 1 addition & 1 deletion src/backend/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import api from './api'
// This is called when server is started, usually to set up the database
const onServerStarted = async (bp: typeof sdk) => {}

// At this point, you would likely setup the API route of your module.
// At this point, you would likely set up the API route of your module.
const onServerReady = async (bp: typeof sdk) => {
await api(bp)
}
Expand Down