{"id":44733962,"url":"https://github.com/shopkeep/bot-scripts","last_synced_at":"2026-02-15T19:27:27.012Z","repository":{"id":32800291,"uuid":"161705573","full_name":"shopkeep/bot-scripts","owner":"shopkeep","description":"Common functionality for botkit slack bots","archived":false,"fork":false,"pushed_at":"2025-04-08T19:30:14.000Z","size":3760,"stargazers_count":4,"open_issues_count":62,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-25T08:29:54.175Z","etag":null,"topics":["botkit","scripts","slackbot"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/@shopkeep/bot-scripts","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/shopkeep.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":"2018-12-13T23:09:59.000Z","updated_at":"2020-09-11T08:22:02.000Z","dependencies_parsed_at":"2025-04-08T20:35:40.796Z","dependency_job_id":null,"html_url":"https://github.com/shopkeep/bot-scripts","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/shopkeep/bot-scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shopkeep%2Fbot-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shopkeep%2Fbot-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shopkeep%2Fbot-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shopkeep%2Fbot-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shopkeep","download_url":"https://codeload.github.com/shopkeep/bot-scripts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shopkeep%2Fbot-scripts/sbom","scorecard":{"id":820673,"data":{"date":"2025-08-11","repo":{"name":"github.com/shopkeep/bot-scripts","commit":"c3465b092486247fbe7db2f0bd1c6b31ec824c27"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.2,"checks":[{"name":"Code-Review","score":3,"reason":"Found 2/6 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating node:14-alpine to node:14-alpine@sha256:434215b487a329c9e867202ff89e704d3a75e554822e07f3e0c0f9e606121b33","Warn: containerImage not pinned by hash: examples/GLaDOS/Dockerfile:1: pin your Docker image by updating node:11-alpine to node:11-alpine@sha256:8bb56bab197299c8ff820f1a55462890caf08f57ffe3b91f5fa6945a4d505932","Warn: containerImage not pinned by hash: examples/basic-example/Dockerfile:1: pin your Docker image by updating node:11-alpine to node:11-alpine@sha256:8bb56bab197299c8ff820f1a55462890caf08f57ffe3b91f5fa6945a4d505932","Warn: npmCommand not pinned by hash: Dockerfile:8","Warn: npmCommand not pinned by hash: examples/GLaDOS/Dockerfile:8","Warn: npmCommand not pinned by hash: examples/basic-example/Dockerfile:8","Info:   0 out of   3 containerImage dependencies pinned","Info:   0 out of   3 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"114 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-42xw-2xvc-qx8m","Warn: Project is vulnerable to: GHSA-4w2v-q235-vp99","Warn: Project is vulnerable to: GHSA-cph5-m8f7-6c5x","Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-rvg8-pwq2-xj7q","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-c6rq-rjc2-86v2","Warn: Project is vulnerable to: GHSA-hpmr-g4pq-jhgp","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-3gx7-xhv7-5mx3","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-7543-mr7h-6v86","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-pc5p-h8pf-mvwp","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-8cf7-32gw-wr33","Warn: Project is vulnerable to: GHSA-hjrf-2m68-5959","Warn: Project is vulnerable to: GHSA-qwph-4952-7xr6","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-8hfj-j24r-96c4","Warn: Project is vulnerable to: GHSA-wc69-rhjr-hc9g","Warn: Project is vulnerable to: GHSA-92xj-mqp7-vmcj","Warn: Project is vulnerable to: GHSA-wxgw-qj99-44c2","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-hjp8-2cm3-cc45","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-w5p7-h5w8-2hfq","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp","Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-fvcj-hvfw-7f2v","Warn: Project is vulnerable to: GHSA-56x4-j7p9-fcf9","Warn: Project is vulnerable to: GHSA-v78c-4p63-2j6c","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq","Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc","Warn: Project is vulnerable to: GHSA-h6q6-9hqw-rwfv","Warn: Project is vulnerable to: GHSA-5fg8-2547-mr8q","Warn: Project is vulnerable to: GHSA-crh6-fp67-6883"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T15:27:34.928Z","repository_id":32800291,"created_at":"2025-08-23T15:27:34.928Z","updated_at":"2025-08-23T15:27:34.928Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29487443,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T15:33:17.885Z","status":"ssl_error","status_checked_at":"2026-02-15T15:32:53.698Z","response_time":118,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["botkit","scripts","slackbot"],"created_at":"2026-02-15T19:27:25.490Z","updated_at":"2026-02-15T19:27:27.002Z","avatar_url":"https://github.com/shopkeep.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bot-scripts\nCommon functionality for botkit slack bots\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://media.giphy.com/media/5yLgocwEzOGUTsT9mKs/giphy.gif\" alt=\"Bot Scripts\" height=\"180\" width=\"320\" /\u003e\n\u003c/p\u003e\n\n---\n\n## Installation\n\n```\nnpm install @shopkeep/bot-scripts\n```\n\n## Quick Start\n\nCopy an example from the `examples/` directory and use as a starting point for\nyour next bot project. Rename the `.env.example` file to `.env` and get the bot\nset up by adding a `SLACK_BOT_TOKEN` into the `.env`.\n\nRun `npm install` to install the dependencies and then start your bot with\n`npm start`. For any further requirements, check the `README.md` file of your\nchosen example.\n\n## What's Provided\n\n`bot-scripts` aims to extact common functionality and tooling, used by botkit\nslack bots, into a centralised repository. It provides three commands:\n\n- `bot-scripts lint` provides consistent tooling versions and configuration for\n  linting rules using [ESLint](https://www.npmjs.com/package/eslint)\n  (and associated plugins) and [Prettier](https://www.npmjs.com/package/prettier).\n- `bot-scripts test` provides consistent tooling versions and configuration\n  for running tests using [Jest](https://www.npmjs.com/package/jest).\n- `bot-scripts start` provides consistent tooling versions and configuration\n  for [Botkit](https://www.npmjs.com/package/botkit), as well as setting up\n  boilerplate functionality and starting your bot.\n\n### Bot Slack Commands\n\nAll bots using this set of scripts will have these slack commands by default:\n\n- `ping` slack command\n  - eg. `@your-bot ping`\n  - Bot will reply with `pong`\n- `help` slack command\n  - eg. `@your-bot help`\n  - Bot will reply a list of slack commands, using the `## Commands` section of\n    the README as the source of this data. (See `examples/` for readme files\n    where this has been used.)\n- `status` slack command\n  - eg. `@your-bot status`\n  - Bot will reply with useful status information including host name, IP\n    address and bot-scripts version. Additional data can be added to this\n    response.\n\n### Development Functionality\n\nYour bot should have an entry point at `src/index.js` which exports a function.\nOn `start`, `bot-scripts` will call this function and provide it with a\n`setupBot` function as a single parameter.\n\n__Basic Example:__\n\nYou can get a complete runnable setup of this example at\n[`examples/basic-example/`](./examples/basic-example/)\n\n```js\n// This emoji will prefix the slack command in the `help` slack command output\nconst customEmojis = {\n  \"my name is\": \":wave:\"\n};\n\n// This will be visible in the `status` slack command output\nconst statusData = {\n  isExampleBot: true\n};\n\n// The bot will listen to slack commands prefixed with the botname string;\n// This means you can call the bot without directly mentioning it.\n// eg. If you had a bot under the handle `@HiBot` you could still call this bot\n// via `example-bot my name is Alice`. This can be of use as part of reminders.\nconst botname = \"example-bot\";\n\nmodule.exports = function(setupBot) { // Function called by bot-scripts start\n  logger.debug(\"Setting up clients\"); // Global `logger` object available\n\n  // Bot instance and `listen` function provided from `setupBot`\n  const { bot, listen } = setupBot({ botname, customEmojis, statusData });\n\n  // Sets up case insensitive listener for \"my name is\" slack command\n  // This can be called via a direct message, @ mention in a channel\n  // or when it's prefixed by the `botname`\n  listen(\"my name is (.+)\", function(bot, message) {\n    // Implement your slack command logic here, eg:\n    // https://botkit.ai/docs/core.html#botreply\n    bot.reply(message, `Hi ${message.match[1]}!`);\n  });\n};\n```\n\n#### Initial Setup\n\nYour entry point function will be provided with a `setupBot` function. This\nfunction should be called with an object, which can contain:\n\n- `botname` - (optional) Name of the bot when\n  [called ambiently](https://botkit.ai/docs/core.html#incoming-message-events)\n  - Defaults to `bot`\n  - eg. `bot ping` would call the `ping` slack command\n- `customEmojis` - (optional) Mapping of slack command string to emoji for\n  `help` output\n  - Used to prefix slack commands with memorable emoji in `help` output.\n    Defaults to `:point_right:`. For simplicity, this will match on slack\n    commands starting with the provided object key, so the entire slack command\n    string isn't required.\n- `statusData` - (optional) Object of data to add to `status` output\n\nThis function returns an object containing the `bot` BotKit instance and a\n`listen` function.\n\n- Generally the `bot` BotKit instance won't be used; but it can be required as\n  a parameter by some of the utility functions (documented later).\n- The `listen` function is used to add slack commands to your bot. The provided\n  `listen` function takes a string to listen for (which can contain regex syntax),\n  which is then converted to a case insensitive regular expression and bound to\n  both targetted means of communication (direct message, direct mention, etc.)\n  and ambient targetting based on the provided `botname` (defaults to \"bot\").\n  This allows for calling the bot as part of Slacks reminder functionality.\n\n#### Logging\n\nA global `logger` variable is provided to output a standard log format to the\nconsole. Log level output can be set via environment variable:\n\n- `LOGGING_LEVEL` - (optional) Level of logging to output.\n  - Defaults to `info` (supports `debug` for verbose logging)\n  - Follows the [Syslog severity levels](https://en.wikipedia.org/wiki/Syslog#Severity_level).\n\n#### Utils\n\nThere are some helpful utilities available which can be imported separately.\nThese are provided under `@shopkeep/bot-scripts/utils` which will provide a\nsingle `util` object containing:\n\n- `getUser` function takes a **bot instance** and a **user ID** and returns a\n  promise which will resolve to a standardised user object, which looks like:\n  - `{ id, name, handle, email, avatar, tz }`\n  - User ID most commonly comes from `message.user`, when looking up the caller\n- `outputError` function takes a **bot instance**, the **message** and an\n  **error message** (or error object) and will reply to the user with the error\n  details.\n- `generateListener` function takes the **bot name**, a **bot instance** and an\n  **array of the [means by which it should listen](https://botkit.ai/docs/core.html#incoming-message-events)**\n  and returns a function which can be used to set up listeners (like the\n  `listen` function provided by `setupBot`).\n  - This should be used when the provided `listen` function isn't suitable and\n     a custom setup for the listen function is required.\n  - Example:\n    ```js\n    const { generateListener } = require(\"@shopkeep/bot-scripts/utils\");\n    const botname = \"example-bot\";\n\n    module.exports = function(setupBot) {\n      const { bot } = setupBot();\n\n      const directListener = generateListener(botname, bot, [\n        // You can add as many or few message events here as you want to bind to\n        // https://botkit.ai/docs/core.html#incoming-message-events\n        'direct_message' // This listener will only bind to direct messages\n      ]);\n\n      directListener(\"my name is (.+)\", function(bot, message) {\n        bot.reply(message, `Hi ${message.match[1]}!`);\n      });\n    };\n    ```\n\n### Infrastructure Support\n\nA healthcheck endpoint is exposed which can be used to determine the health of\nthe bot. This returns a `200` when the Slack real-time messaging websocket\nconnection available, and a `503` when it is not.\n\n- `HEALTH_CHECK_PORT` - (optional) Port used for health check endpoint.\n  - Defaults to `9000`\n\n## Contributing\n\nPull requests on this repository are very welcome. There is test and linting\ntooling in place. Formatting is provided by prettier. This project uses the same\nlinting and testing tooling as provided to any bots which use these scripts.\n\n### Docker\n\nUse `docker-compose` to build the environment, and run tests and lint.\n```\ndocker-compose build test\ndocker-compose run test    # Test and lint\n```\n\n### Locally\n\nMake sure you have Node.js and npm available locally. Install dependencies and\nrun the test and linting tasks.\n```\nnpm install\nnpm test        # Run all tests with jest\nnpm run lint    # Lint the codebase with eslint\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshopkeep%2Fbot-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshopkeep%2Fbot-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshopkeep%2Fbot-scripts/lists"}