{"id":15602119,"url":"https://github.com/shiv19/node-rivebot","last_synced_at":"2025-08-22T13:37:04.702Z","repository":{"id":102163941,"uuid":"107863465","full_name":"shiv19/node-rivebot","owner":"shiv19","description":"RiveScript bot server","archived":false,"fork":false,"pushed_at":"2017-10-22T19:24:14.000Z","size":23,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-03T16:48:03.911Z","etag":null,"topics":["ai","bot","chat"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shiv19.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":"2017-10-22T12:22:53.000Z","updated_at":"2017-11-03T12:46:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"e4e31495-62c2-423a-a719-6acd3998bb81","html_url":"https://github.com/shiv19/node-rivebot","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/shiv19%2Fnode-rivebot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiv19%2Fnode-rivebot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiv19%2Fnode-rivebot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiv19%2Fnode-rivebot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shiv19","download_url":"https://codeload.github.com/shiv19/node-rivebot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240229972,"owners_count":19768597,"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":["ai","bot","chat"],"created_at":"2024-10-03T02:37:43.213Z","updated_at":"2025-02-22T20:14:59.895Z","avatar_url":"https://github.com/shiv19.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-rivebot [v1.0.0]\n[![Twitter URL](https://img.shields.io/badge/twitter-%40MultiShiv19-blue.svg)](https://twitter.com/MultiShiv19)\n\nExample Bot made using RiveScript.\n\nThis uses Expressjs to create a super simple web server that accepts JSON POST\nrequests to `/reply` and responds with JSON output.\n\n## Live usage\nThis bot is being used as a backend for \u003ca href=\"https://github.com/shiv19/nativescript-rivescript-demo\" target=\"_blank\"\u003ethis\u003c/a\u003e NativeScript App\n\n## Run the Example\n\n```bash\n$ npm install\n\n$ node server.js\n```\n\nAnd then from another terminal, you can use `curl` to test the JSON endpoint for\nthe chatbot. Or, you can use your favorite REST client.\n\n## API Documentation\n\nThis simple Express server only has one useful endpoint: `POST /reply`. All\nother endpoints will return simple usage instructions (basically, a `curl`\ncommand that you can paste into a terminal window).\n\n### POST /reply\n\n**Parameters (`application/json`):**\n\n```json\n{\n\t\"username\": \"Shiva\",\n\t\"message\": \"Hello, bot!\",\n\t\"vars\": {\n\t\t\"name\": \"Shiva\",\n\t\t\"age\": \"10\"\n\t}\n}\n```\n\nThe required parameters are `username` and `message`. You can provide `vars` to\nsend along user variables.\n\n**Response:**\n\n```json\n{\n\t\"status\": \"ok\",\n\t\"reply\": \"Hello human!\",\n\t\"vars\": {\n\t\t\"topic\": \"random\",\n\t\t\"name\": \"Shiva\",\n\t\t\"age\": \"10\",\n\t\t\"__history__\": {},\n\t\t\"__lastmatch__\": \"hello bot\"\n\t}\n}\n```\n\nThe response includes `status` (\"ok\" or \"error\"), `reply` which is the bot's\nresponse, and `vars` which are the user variables. To keep state between\nrequests, you should send *back* the `vars` data with the following request.\nFor example if the first request said \"my name is soandso\", `vars.name` will\nbe \"Soandso\" in the response. Passing the same `vars` back with the next\nrequest will cause the bot to \"remember\" the name, and be able to keep track of\nthe user over multiple requests.\n\nIn case of error, a `message` key will contain the error message.\n\n## Example Output\n\n```bash\ncurl -i \\\n   -H \"Content-Type: application/json\" \\\n   -X POST -d '{\"username\":\"Shiva\",\"message\":\"hello bot\"}' \\\n   http://localhost:2001/reply\nHTTP/1.1 200 OK\nX-Powered-By: Express\nContent-Type: application/json; charset=utf-8\nContent-Length: 913\nETag: W/\"391-AgDgznci+rSclUCAK4w2EA\"\nDate: Tue, 19 Jan 2016 00:49:27 GMT\nConnection: keep-alive\n\n{\n    \"status\": \"ok\",\n    \"reply\": \"How do you do. Please state your problem.\",\n    \"vars\": {\n        \"topic\": \"random\",\n        \"__history__\": {\n            \"input\": [\n                \"hello bot\",\n                \"undefined\",\n                \"undefined\",\n                \"undefined\",\n                \"undefined\",\n                \"undefined\",\n                \"undefined\",\n                \"undefined\",\n                \"undefined\",\n                \"undefined\"\n            ],\n            \"reply\": [\n                \"How do you do. Please state your problem.\",\n                \"undefined\",\n                \"undefined\",\n                \"undefined\",\n                \"undefined\",\n                \"undefined\",\n                \"undefined\",\n                \"undefined\",\n                \"undefined\",\n                \"undefined\"\n            ]\n        },\n        \"__lastmatch__\": \"(hello|hi|hey|howdy|hola|hai|yo) [*]\",\n        \"__initialmatch__\": \"(hello|hi|hey|howdy|hola|hai|yo) [*]\"\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiv19%2Fnode-rivebot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshiv19%2Fnode-rivebot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiv19%2Fnode-rivebot/lists"}