{"id":19732876,"url":"https://github.com/riptl/dialog-botkit-module","last_synced_at":"2026-05-11T01:39:05.955Z","repository":{"id":96132183,"uuid":"173834539","full_name":"riptl/dialog-botkit-module","owner":"riptl","description":"This is botkit.ai adapter for dialog platform","archived":true,"fork":false,"pushed_at":"2019-04-18T00:58:37.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-13T21:25:52.362Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/riptl.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}},"created_at":"2019-03-04T22:53:41.000Z","updated_at":"2025-05-31T09:34:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"76c93bf0-624f-4139-b4c1-a3beb7072e2b","html_url":"https://github.com/riptl/dialog-botkit-module","commit_stats":null,"previous_names":["riptl/dialog-botkit-module"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/riptl/dialog-botkit-module","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riptl%2Fdialog-botkit-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riptl%2Fdialog-botkit-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riptl%2Fdialog-botkit-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riptl%2Fdialog-botkit-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riptl","download_url":"https://codeload.github.com/riptl/dialog-botkit-module/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riptl%2Fdialog-botkit-module/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285884980,"owners_count":27248045,"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","status":"online","status_checked_at":"2025-11-22T02:00:05.934Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-12T00:28:17.005Z","updated_at":"2025-11-23T01:02:22.129Z","avatar_url":"https://github.com/riptl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Botkit and Dialogs\n\nTODO Table of Contents\n\n## Getting Started\n\nWarning: Node 10+ required.\n\n#### dlg()\n| Argument | Description\n|--- |---\n| config | an object containing configuration options\n\nReturns a new Botkit SlackBot controller.\n\nThe `config` argument is an object with these properties:\n\n| Name | Type | Description\n|--- |--- |---\n| debug | Boolean | Enable debug logging\n| token | string | dialog bot token\n| endpoints | array | list of dialog grpc endpoints\n\nFor example:\n\n```javascript\nvar dlg = require('@dlghq/botkit-module');\n\nvar controller = dlg({\n    token: process.env.DIALOGS_TOKEN,\n    endpoints: [process.env.DIALOGS_ENDPOINT],\n    scopes: ['bot'],\n});\n```\n\n## Event List\n\nIn addition to the [core events that Botkit fires](core.md#receiving-messages-and-events), this connector also fires some platform specific events.\n\nIn fact, Botkit will receive, normalize and emit any event that it receives from Dialog.\n\n### Incoming Message Events\n| Event | Description\n|--- |---\n| direct_message | the bot received a direct message from a user\n| direct_mention | the bot was addressed directly in a channel\n| mention | the bot was mentioned by someone in a message\n| ambient | the message received had no mention of the bot\n| action_event | the user has responded to an action group\n\n### User Activity Events:\n| Event | Description\n|--- |---\n| bot_group_join | the bot has joined a group\n| user_group_join | a user has joined a group\n| bot_group_left | the bot has left a group\n| user_group_left | a user has left a group\n\n\n## Files\n\n### Receiving\n\nFiles sent by other users trigger the `file_share` event.\n`message.raw_message.document` contains the file information.\n\n### Sending\n\n#### Regular files\n\nSend a message object with a file property:\n```js\nbot.reply(message, {\n    file: {\n        path: '/path/to/file'\n    }\n})\n```\n\n#### Images\n\nSame as regular files, but set `image`:\n\n```js\nbot.reply(message, {\n    file: {\n        path: '/path/to/file.jpg',\n        image: true\n    }\n})\n```\n\n## Interactive Content\n\nTODO More detailed explanation\n\n### Sending ActionGroups\n\nSend a message with an `actions` object.\nThe top level `actions` is an [ActionGroup](https://dialogs.github.io/js-bot-sdk/classes/actiongroup.html).\n\nEach `ActionGroup` contains multiple [Actions](https://dialogs.github.io/js-bot-sdk/classes/action.html)\nthat can be either Buttons or Selects at the time of writing.\nAn Action has a unique `id` that will be used to match user responses.\n\n```js\nbot.reply(message, {\n    actions: ActionGroup.create({\n        title: 'Continue?',\n        description: 'Switch to Dialogs, the handy and feature-rich enterprise multi-device messenger?',\n        actions: [\n            Action.create({\n                id: 'continue_yes',\n                style: ActionStyle.PRIMARY,\n                widget: Button.create({ label: 'Yes!' })\n            }),\n            Action.create({\n                id: 'continue_no',\n                style: ActionStyle.DANGER,\n                widget: Button.create({ label: 'No :(' })\n            }),\n            Action.create({\n                id: 'continue_unsure',\n                style: ActionStyle.DEFAULT,\n                widget: Button.create({ label: 'Maybe later.' })\n            })\n        ]\n    })\n});\n```\n\n### Receiving responses\n\nWhen a user clicks an Action sent by the bot,\nthe bot receives an `action_event` type message.\nThe content of the message is the action `id`.\n\nThe easiest way to handle interactive action clicks are [Botkit conversations](https://botkit.ai/docs/core.html#multi-message-conversations).\nLet's take the action group above and re-use it in conversation logic:\n\n```js\n// Action message from above\nconst response = { actions: ActionGroup.create({ /*...*/ }) };\n\nbot.startConversation(message, function(err, convo) {\n    convo.ask(response, [\n        {\n            pattern: /^continue_yes$/, // Match the full message ID\n            callback: (response, convo) =\u003e {\n                convo.say(\"That's great! Visit https://dlg.im/en to get a plan.\");\n                convo.next();\n            }\n        },\n        {\n            pattern: /^continue_no$/,\n            callback: (response, convo) =\u003e {\n                convo.say('No problem');\n                convo.next();\n            }\n        }\n    ]);\n});\n```\n\nOf course, you can have nested `convo.ask` calls for arbitrarily complex conversation chains.\n\n### Updating user content\n\nTODO\n\n## Testing Bot\n\nThis repo contains a test Botkit bot that demonstrates the features of the Dialogs platform.\n\n#### Installation\n\n```shell\ngit clone https://github.com/dialogs/dialog-botkit-module\ncd dialog-botkit-module\nnpm install\nexport DIALOGS_ENDPOINT=https://grpc-test.transmit.im:9443\nexport DIALOGS_TOKEN=xxx\n./test.js\nThe testing bot will demonstrate all the features implemented in this PR.\nSent @\u003cusername\u003e help to start.\n```\n\n#### Usage\n\nMention the bot like this: `@bot help` to get started with the features.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friptl%2Fdialog-botkit-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friptl%2Fdialog-botkit-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friptl%2Fdialog-botkit-module/lists"}