{"id":20032524,"url":"https://github.com/nbransby/dialogue-builder-example","last_synced_at":"2026-06-09T00:32:46.897Z","repository":{"id":145643709,"uuid":"80076799","full_name":"nbransby/dialogue-builder-example","owner":"nbransby","description":"Example of using https://github.com/nbransby/dialogue-builder","archived":false,"fork":false,"pushed_at":"2017-04-04T23:53:26.000Z","size":24,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-02T05:28:57.538Z","etag":null,"topics":["bot-builder","dialogue-builder","facebook-messenger","messenger-bot","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nbransby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-26T01:44:30.000Z","updated_at":"2018-02-17T15:44:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"09d38d58-955b-43f9-a925-34b306474cc7","html_url":"https://github.com/nbransby/dialogue-builder-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nbransby/dialogue-builder-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbransby%2Fdialogue-builder-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbransby%2Fdialogue-builder-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbransby%2Fdialogue-builder-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbransby%2Fdialogue-builder-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nbransby","download_url":"https://codeload.github.com/nbransby/dialogue-builder-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbransby%2Fdialogue-builder-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34086664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot-builder","dialogue-builder","facebook-messenger","messenger-bot","typescript"],"created_at":"2024-11-13T09:38:10.214Z","updated_at":"2026-06-09T00:32:46.881Z","avatar_url":"https://github.com/nbransby.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dialogue-builder-example\n\nA working example of a bot utilising dialogue-builder including persistence of dialogue state.\n\nThis example is written in TypeScript and consists of two files `bot.ts` and `onboarding.ts`, (`bot.js` and `onboarding.js` contain the transpiled TypeScript - not a pretty sight). \n\nThere is also `bot.esnext.js` and `onboarding.esnext.js` which is my attempt to implement the example without TypeScript but still using all the advanced JS syntax such as async/await and object destructuring. Although I haven't tried it myself, by using babel it should be possible to compile this down to es5 which is necessary to run on AWS Lambda.\n\nDialogue Builder depends on [bot-builder](https://github.com/claudiajs/claudia-bot-builder) by [claudia.js](https://claudiajs.com/) who's [command line tool](https://claudiajs.com/documentation.html#args) supports deploying to AWS Lambda. But in this  example we use the [Serverless Framework](https://serverless.com/) for deployment as it also supports automated provisioning of DynamoDB instances which is used in this example to store the dialog state.\n\n#### To deploy this example so you can test it in Facebook Messenger you will need to do the following:\n\n* #####Create a Facebook App\n\u003e Create a new [Facebook App](https://developers.facebook.com/apps) or use an existing one. In the `serverless.yml` file, replace `REPLACE_WITH_APP_SECRET` with your Facebook App Secret\n\n* #####Create a Facebook Page\n\u003e Create a new [Page](https://www.facebook.com/pages/create) or use an existing one, then go to the App Dashboard and under Product Settings click \"Add Product\" and select \"Messenger.\"\n\u003e \n![step1](https://scontent-ams3-1.xx.fbcdn.net/v/t39.2178-6/12995587_195576307494663_824949235_n.png?oh=c2d8210d366a5650df958c86a08792c5\u0026oe=596749C3)\n\u003e \nIn the Token Generation section, select your Page. A Page Access Token will be generated for you. \n\u003e \n![step3](https://scontent-ams3-1.xx.fbcdn.net/v/t39.2178-6/12995543_1164810200226522_2093336718_n.png?oh=582e1b57f6e9b3f67f5a007d887d5fb8\u0026oe=59329209)\n\u003e \nIn the `serverless.yml` file, replace`REPLACE_WITH_PAGE_ACCESS_TOKEN` with your Page Access Token\n\n* #####Install serverless and setup your AWS account credentials on your machine\n\u003e https://serverless.com/framework/docs/providers/aws/guide/installation/ \n\u003e \nMake sure to also follow [these instructions](https://serverless.com/framework/docs/providers/aws/guide/credentials) on setting up AWS credentials\n\n* #####Run the following in the root of this directory and, once complete, copy the URL returned\n\n        npm install\n        serverless deploy\n\n* #####Setup the Webhook on Facebook with the URL as the Callback URL and `SOMETHING_RANDOM` as the verify token\n\u003e In the Webhooks section, click \"Setup Webhooks.\"\n\u003e \n![webhook](https://scontent-lhr3-1.xx.fbcdn.net/t39.2178-6/13331609_660771177408445_306127577_n.png)\n\u003e \nEnter a URL for a webhook, enter a Verify Token and select `messages` and `messaging_postbacks` under Subscription Fields.\n\u003e\n![subscription](https://scontent-ams3-1.xx.fbcdn.net/v/t39.2178-6/12057143_211110782612505_894181129_n.png?oh=132ce46ea1a96b8a91cbe387492943b5\u0026oe=593C4AF1)\n\n* #####Subscribe the App to the Page on Facebook\n\u003e In the Webhooks section, you can subscribe the webhook for a specific page.\n\u003e \n\u003e ![enter image description here](https://scontent-ams3-1.xx.fbcdn.net/v/t39.2178-6/13421551_1702530599996541_471321650_n.png?oh=75f68bbf43a5a25d98464babc1232a25\u0026oe=5939AA9F)\n\n* #####Try your new bot\n\u003eGo to your Facebook Page and send a message to it. The bot should respond!\n\u003e\n![page](https://scontent-ams3-1.xx.fbcdn.net/v/t39.2178-6/13331537_288414224831849_853132949_n.png?oh=5f381f9f42de44be26539da6ed663d09\u0026oe=5930C11B)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbransby%2Fdialogue-builder-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnbransby%2Fdialogue-builder-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbransby%2Fdialogue-builder-example/lists"}