{"id":21134515,"url":"https://github.com/billba/botbldr","last_synced_at":"2025-09-12T11:33:57.687Z","repository":{"id":125884630,"uuid":"126488184","full_name":"billba/botbldr","owner":"billba","description":"Get up and running quickly with BotBuilder v4 with bot classes that add features to context and hide the messy plumbing.","archived":false,"fork":false,"pushed_at":"2018-05-10T18:48:58.000Z","size":25,"stargazers_count":4,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T12:44:36.158Z","etag":null,"topics":["botbuilder"],"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/billba.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":"2018-03-23T13:21:29.000Z","updated_at":"2023-08-27T00:15:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"a77c8054-fe6e-44ec-aa79-1fbb8b565b93","html_url":"https://github.com/billba/botbldr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/billba/botbldr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billba%2Fbotbldr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billba%2Fbotbldr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billba%2Fbotbldr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billba%2Fbotbldr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/billba","download_url":"https://codeload.github.com/billba/botbldr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billba%2Fbotbldr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264652738,"owners_count":23644322,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["botbuilder"],"created_at":"2024-11-20T06:30:25.208Z","updated_at":"2025-07-10T20:33:07.430Z","avatar_url":"https://github.com/billba.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# botbldr\n\nGet up and running quickly with BotBuilder v4 with bot classes that add features to `context` and hide the messy plumbing.\n\nYou can use predefine classes for console and service bots, or bake your own.\n\n**This is an experimental project subject to change without notice. Use at your own risk. Not an officially supported Microsoft product.**\n\n## How do I use it?\n\n```\nnpm install --save botbuilder-botbldr\n```\n\n## What does it look like?\n\nHere's an echobot using the predefined `ConsoleBot`:\n\n```ts\nimport { ConsoleBot } from 'botbuilder-botbldr';\n\nconst bot = new ConsoleBot();\n\nbot.onTurn(async context =\u003e {\n    context.conversationState.count = context.conversationState.count === undefined ? 0 : context.conversationState.count + 1;\n    await context.sendActivity(`${context.conversationState.count}: You said \"${context.request.text}\"`);\n});\n```\n\nSwap out `ConsoleBot` for `ServiceBot` to test your bot with Emulator then run it in the cloud in the Azure Bot Service.\n\nBoth use an extended version of `BotContext` called `StateContext` which adds `.conversationState` and `.userState` properties to `context`. Any changes you make to either of these are automatically persisted at the end of each turn. By default they use `MemoryStorage` as a state storage provider, but you can pass in any you like, e.g.\n\n```ts\nconst bot = new ConsoleBot(new FileStorage(\"path_to_your_file\"));\n```\n\nIf you use TypeScript you can define types for these properties:\n\n```ts\nimport { ConsoleBot } from 'botbuilder-botbldr';\n\ninterface MyConversationState {\n    count: number;\n}\n\ninterface MyUserState {\n    name: string;\n}\n\nconst bot = new ConsoleBot\u003cMyConversationState, MyUserState\u003e();\n\nbot.onTurn(async context =\u003e {\n    context.conversationState.count = context.conversationState.count === undefined ? 0 : context.conversationState.count + 1;\n    await context.sendActivity(`${context.conversationState.count}: You said \"${context.request.text}\"`);\n});\n```\n\n## I don't like how you extended `context` (or I want to extend it more)\n\nNo problem, you can make your own extended context following the recipe used in [/src/StateContext.ts](/src/StateContext.ts). Then extend `BaseBot` following the recipe used in [/src/StateBot.ts](/src/StateBot.ts) and [/src/ConsoleBot.ts](/src/ConsoleBot.ts)\n\n## Can I add my own middleware?\n\nSure, just add:\n\n```ts\nbot.use(new BestMiddlewareEver())\n```\n\nbefore your call to `bot.onRequest`\n\n## Can I use proactive messages?\n\nYes!\n\n```ts\nconst calledBySomeEventSomewhere = async (activity: Activity) =\u003e {\n    await bot.continueConversation(activity, async context =\u003e {\n        await context.sendActivity(`Something happened!`);\n    });\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbillba%2Fbotbldr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbillba%2Fbotbldr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbillba%2Fbotbldr/lists"}