{"id":16979360,"url":"https://github.com/marcl/botkit-middleware-typing","last_synced_at":"2026-05-02T03:31:46.311Z","repository":{"id":34300196,"uuid":"157452148","full_name":"MarcL/botkit-middleware-typing","owner":"MarcL","description":"BotKit middleware to enable typing indicator on platforms that support it","archived":false,"fork":false,"pushed_at":"2023-01-03T17:54:56.000Z","size":1416,"stargazers_count":1,"open_issues_count":12,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-06T20:16:45.677Z","etag":null,"topics":["botkit","botkit-middleware","chatbots","messenger","slack"],"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/MarcL.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}},"created_at":"2018-11-13T21:53:21.000Z","updated_at":"2023-03-10T09:58:30.000Z","dependencies_parsed_at":"2023-01-15T06:16:03.724Z","dependency_job_id":null,"html_url":"https://github.com/MarcL/botkit-middleware-typing","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcL%2Fbotkit-middleware-typing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcL%2Fbotkit-middleware-typing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcL%2Fbotkit-middleware-typing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcL%2Fbotkit-middleware-typing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarcL","download_url":"https://codeload.github.com/MarcL/botkit-middleware-typing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369953,"owners_count":20927928,"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":["botkit","botkit-middleware","chatbots","messenger","slack"],"created_at":"2024-10-14T01:45:35.666Z","updated_at":"2026-05-02T03:31:46.263Z","avatar_url":"https://github.com/MarcL.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# botkit-middleware-typing\n\nBotKit middleware to enable the typing indicator on [Facebook](#issues) for all messages. This will include those sent via [Botkit conversations](https://botkit.ai/docs/core.html#multi-message-conversations).\n\n## Install\n\nAdd the module to your `package.json` using either `npm` or `yarn`.\n\n```\nnpm install botkit-middleware-typing\n```\n\nOR\n\n```\nyarn add botkit-middleware-typing\n```\n\n## Use\n\nInclude the middleware in your Botkit application.\n\n```\nconst botkitTypingMiddleware = require('botkit-middleware-typing');\n```\n\nAdd this as a [Botkit send middleware](https://botkit.ai/docs/middleware.html#send-middleware):\n\n```\nconst controller = Botkit.facebookbot(botConfig);\n\nconst typingMiddleware = botkitTypingMiddleware();\n\ncontroller.middleware.send.use(typingMiddleware);\n```\n\n## Configuration\n\nYou can configure the typing delay for the middleware with the following optional parameters.\nThis will allow you to set a maximum delay or allows you to set a delay for all typing.\n\n| Property             |                  Description                  |\n| -------------------- | :-------------------------------------------: |\n| maximumTypingDelayMs | Sets the maximum typing delay in milliseconds |\n| typingDelayMs        | Sets a specified typing delay in milliseconds |\n\n### Examples\n\nSet the maximum typing delay to 1 second.\n\n```\nconst typingMiddleware = botkitTypingMiddleware({\n    maximumTypingDelayMs: 1000\n});\n\ncontroller.middleware.send.use(typingMiddleware);\n```\n\nSet all typing delays to 4.5 seconds.\n\n```\nconst typingMiddleware = botkitTypingMiddleware({\n    typingDelayMs: 4500\n});\n\ncontroller.middleware.send.use(typingMiddleware);\n```\n\n## Issues\n\nWith the current implementation of Botkit, there's no easy way to tell which platform the bot is running on. This middleware makes an assumption that the bot supports typing if it has a `bot.startTyping` method. This is currently avaible on Facebook and Slack. Currently only Facebook is supported but I'll look to add Slack shortly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcl%2Fbotkit-middleware-typing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcl%2Fbotkit-middleware-typing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcl%2Fbotkit-middleware-typing/lists"}