{"id":15693686,"url":"https://github.com/doowb/base-bot","last_synced_at":"2025-05-08T04:48:33.034Z","repository":{"id":65990608,"uuid":"48391308","full_name":"doowb/base-bot","owner":"doowb","description":"Simple bot that knows how to handle events when told too. Use base bot to build more complex bots with plugins.","archived":false,"fork":false,"pushed_at":"2017-05-15T15:50:42.000Z","size":10,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-08T04:48:22.274Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doowb.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},"funding":{"github":["doowb","jonschlinkert"]}},"created_at":"2015-12-21T19:57:02.000Z","updated_at":"2021-04-12T21:57:02.000Z","dependencies_parsed_at":"2023-03-10T23:26:54.975Z","dependency_job_id":null,"html_url":"https://github.com/doowb/base-bot","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":"0.11111111111111116","last_synced_commit":"c85d063fcabc6123e2d52730e8d77fe7f2675ae2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fbase-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fbase-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fbase-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fbase-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doowb","download_url":"https://codeload.github.com/doowb/base-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253002842,"owners_count":21838637,"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":[],"created_at":"2024-10-03T18:47:10.199Z","updated_at":"2025-05-08T04:48:33.009Z","avatar_url":"https://github.com/doowb.png","language":"JavaScript","funding_links":["https://github.com/sponsors/doowb","https://github.com/sponsors/jonschlinkert"],"categories":[],"sub_categories":[],"readme":"# base-bot [![NPM version](https://img.shields.io/npm/v/base-bot.svg)](https://www.npmjs.com/package/base-bot)\n\n\u003e Simple bot that knows how to handle events when told too. Use base bot to build more complex bots with plugins.\n\n## Install\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i base-bot --save\n```\n\n## Usage\n\n```js\nvar bot = require('base-bot');\n```\n\n## API\n\n### [BaseBot](index.js#L24)\nCreate a new instance of a BaseBot with provided options.\n\n\n**Params**\n\n* `options` **{Object}**: Options to configure the github bot.    \n\n**Example**\n\n\n\n```js\nvar bot = new BaseBot();\n```\n\n\n### [.handle](index.js#L52)\nHandle a payload object. The `payload` will be passed to all registered handlers. Handlers may modify the `payload` and return it in their `callback`. The aggregated results will be returned in the `handle` `callback`.\n\n\n**Params**\n\n* `event` **{String}**: Event type to handle. Only listeners registered for this type will be notified.    \n* `payload` **{Object}**: Payload object to handle.    \n* `cb` **{Function}**: Callback to notify call when finished handling payload.    \n\n**Example**\n\n\n\n```js\nbot.handle('issue', payload, function(err, results) {\n  if (err) return console.error(err);\n  console.log(results);\n});\n```\n\n\n### [.handler](index.js#L79)\nAdd a specific `on` and `handle` methods for an event.\n\n\n**Params**\n\n* `method` **{String}**: Name of the methods to add.    \n* `returns` **{Object}** `this`: for chaining.  \n\n**Example**\n\n\n\n```js\nbot.handler('issue');\nbot.onIssue(function(payload, cb) { cb(null, payload); });\nbot.handleIssue(payload, function(err, results) {\n  if (err) return console.error(err);\n  console.log(results);\n});\n```\n\n\n### [.handlers](index.js#L116)\nAdd a specific `on` and `handle` methods for an array of events.\n\n\n**Params**\n\n* `methods` **{String|Array}**: Array of method names to add.    \n* `returns` **{Object}** `this`: for chaining.  \n\n**Example**\n\n\n\n```js\nbot.handlers(['issue', 'commit']);\n\nbot.onIssue(function(payload, cb) { cb(null, payload); });\nbot.onCommit(function(payload, cb) { cb(null, payload); });\n\nbot.handleIssue(payload, function(err, results) {\n  if (err) return console.error(err);\n  console.log(results);\n});\n\nbot.handleCommit(payload, function(err, results) {\n  if (err) return console.error(err);\n  console.log(results);\n});\n```\n\n\n\n## Related projects\n* [base-methods](https://www.npmjs.com/package/base-methods): base-methods is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://www.npmjs.com/package/base-methods) | [homepage](https://github.com/jonschlinkert/base-methods)\n* [use](https://www.npmjs.com/package/use): Easily add plugin support to your node.js application. | [homepage](https://github.com/jonschlinkert/use)\n\n## Running tests\nInstall dev dependencies:\n\n```sh\n$ npm i -d \u0026\u0026 npm test\n```\n\n## Contributing\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/doowb/base-bot/issues/new).\n\n## Author\n**Brian Woodward**\n\n+ [github/doowb](https://github.com/doowb)\n+ [twitter/doowb](http://twitter.com/doowb)\n\n## License\nCopyright © 2015 [Brian Woodward](https://github.com/doowb)\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb](https://github.com/verbose/verb) on December 21, 2015._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Fbase-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoowb%2Fbase-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Fbase-bot/lists"}