{"id":19391929,"url":"https://github.com/fwd/chatbot","last_synced_at":"2025-04-24T00:31:56.110Z","repository":{"id":50679452,"uuid":"399598922","full_name":"fwd/chatbot","owner":"fwd","description":"NodeJS Chatbot Framework, configurable in JSON.","archived":false,"fork":false,"pushed_at":"2022-09-05T21:31:09.000Z","size":350,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T22:51:15.367Z","etag":null,"topics":["chatbot","chatbot-framework","chatbots-framework","nodejs","open-source"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/fwd.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}},"created_at":"2021-08-24T20:39:12.000Z","updated_at":"2022-09-05T21:36:01.000Z","dependencies_parsed_at":"2022-09-08T01:22:34.682Z","dependency_job_id":null,"html_url":"https://github.com/fwd/chatbot","commit_stats":null,"previous_names":["formsend/chatbot"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwd%2Fchatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwd%2Fchatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwd%2Fchatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwd%2Fchatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fwd","download_url":"https://codeload.github.com/fwd/chatbot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250539512,"owners_count":21447327,"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":["chatbot","chatbot-framework","chatbots-framework","nodejs","open-source"],"created_at":"2024-11-10T10:29:44.447Z","updated_at":"2025-04-24T00:31:54.236Z","avatar_url":"https://github.com/fwd.png","language":"JavaScript","readme":"![Cover](https://raw.githubusercontent.com/fwd/chatbot/master/.github/hero.png)\n\n\u003e Modular NodeJS Chatbot Framework\n\n## Install\n\n```sh\nnpm i @fwd/chatbot\n``` \n\n## Express Example\n```javascript\nconst chatbot = require('@fwd/chatbot')\nconst express = require('express')\nconst app = express()\nconst port = 3000\n\nvar answers = [\n\t{\n\t\tname: \"Cookie\",\n\t\tconfirmation: \"Do you want a cookie?\",\n\t\ttriggers: [ \"cookie\" ],\n\t\tfields: [\n\t\t\t{\n\t\t\t\tlabel: \"What flavor?\",\n\t\t\t\tname: \"flavor\"\n\t\t\t},\n\t\t],\n\t\taction: async (fields) =\u003e {\n\t\t\tconsole.log( fields.flavor )\n\t\t\treturn `🍪`\n\t\t}\n\t},\n]\n\napp.get('/', async (req, res) =\u003e {\n\tif (!req.query.message) return res.send(\"Message is required.\")\n\tres.send( await chatbot('contextId', req.query.message, answers) )\n})\n\napp.listen(port, () =\u003e {\n  console.log(`Example app listening at http://localhost:${port}`)\n})\n```\n\n### Terminal Chatbot 😎\n\n```javascript\nconst chatbot = require('@fwd/chatbot')\nconst readline = require('readline');\n\nconst rl = readline.createInterface({\n  input: process.stdin,\n  output: process.stdout\n});\n\nvar answers = [\n\t{\n\t\tname: \"Cookie\",\n\t\tconfirmation: \"Do you want a cookie?\",\n\t\ttriggers: [ \"cookie\" ],\n\t\tfields: [\n\t\t\t{\n\t\t\t\tlabel: \"What flavor?\",\n\t\t\t\tname: \"flavor\"\n\t\t\t},\n\t\t],\n\t\taction: async (fields) =\u003e {\n\t\t\tconsole.log( fields )\n\t\t\treturn `🍪`\n\t\t}\n\t},\n]\n\nvar recursiveAsyncReadLine = function () {\n  rl.question('\u003e ', async (answer) =\u003e {\n    if (answer == 'exit') return rl.close()\n    if (answer == 'clear') return console.clear()\n    console.log( await chatbot('jenkins', answer, answers) )\n    recursiveAsyncReadLine();\n  });\n};\n\nrecursiveAsyncReadLine();\n```\n\n## ❯ Contributing\n\nGive a ⭐️ if this project helped you!\n\nContributions, issues and feature requests are welcome at [issues page](https://github.com/fwd/chatbot/issues).\n\n## ❯ License\n\nMIT License\n\nCopyright © [@nano2dev](https://twitter.com/nano2dev).\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n## ❯ Stargazers\n\n[![Stargazers over time](https://starchart.cc/fwd/chatbot.svg)](https://github.com/fwd/chatbot)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwd%2Fchatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffwd%2Fchatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwd%2Fchatbot/lists"}