{"id":22300748,"url":"https://github.com/paladin-t/bot","last_synced_at":"2025-07-06T12:05:02.702Z","repository":{"id":77919128,"uuid":"309930477","full_name":"paladin-t/bot","owner":"paladin-t","description":"Possibly the minimal rule based chatbot implementation in plain JavaScript.","archived":false,"fork":false,"pushed_at":"2020-11-05T08:02:18.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-30T20:43:53.305Z","etag":null,"topics":["bot","chatbot","javascript"],"latest_commit_sha":null,"homepage":"https://paladin-t.github.io/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paladin-t.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-11-04T07:51:12.000Z","updated_at":"2020-11-05T08:02:21.000Z","dependencies_parsed_at":"2023-02-25T20:30:26.039Z","dependency_job_id":null,"html_url":"https://github.com/paladin-t/bot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paladin-t%2Fbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paladin-t%2Fbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paladin-t%2Fbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paladin-t%2Fbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paladin-t","download_url":"https://codeload.github.com/paladin-t/bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245559777,"owners_count":20635435,"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":["bot","chatbot","javascript"],"created_at":"2024-12-03T18:13:50.350Z","updated_at":"2025-07-06T12:05:02.695Z","avatar_url":"https://github.com/paladin-t.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bot\n\nPossibly the minimal rule based chatbot implementation in plain JavaScript.\n\n[Demo](https://paladin-t.github.io/)\n\n## Usage\n\n### Pattern configuration\n\n```js\nfunction setUserName (bot, matched) {\n  bot.setUserName(matched[matched.length - 1]);\n  bot.post('Call me Toby.');\n}\n\nvar patterns = [\n  {\n    request: [ 'greetings' ],\n    response: [ 'Hi.', 'Hello.' ],\n    callback: function (bot) {\n      if (!bot.getUserName()) {\n        bot.setNextFailureHandler({\n          response: [ 'Nice to meet you {USER_NAME}.' ],\n          callback: setUserName\n        });\n        bot.post('What\\'s your name?');\n      }\n    }\n  },\n  {\n    request: [ 'hi' ],\n    alias: [ 'greetings' ]\n  },\n  {\n    request: [ 'hello' ],\n    alias: [ 'greetings' ]\n  },\n\n  {\n    request: [ 'what', 'your', 'name' ],\n    response: [ 'Call me Toby.', 'I\\'m Toby.' ]\n  },\n\n  {\n    request: [ 'my', 'name' ],\n    response: [ 'Nice to meet you {USER_NAME}.' ],\n    callback: setUserName\n  },\n  {\n    request: [ 'call', 'me' ],\n    alias: [ 'my', 'name' ]\n  }\n];\n```\n\n### Chat\n\n```js\nvar bot = new Bot.Bot();\npatterns.forEach(function (pattern) {\n  bot.learn(pattern);\n});\n\nbot.think('Hi!', function (rsp) {\n  console.log(rsp);\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaladin-t%2Fbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaladin-t%2Fbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaladin-t%2Fbot/lists"}