{"id":24938589,"url":"https://github.com/danclay/simple-dialogflow-client","last_synced_at":"2026-03-01T19:34:19.280Z","repository":{"id":39965997,"uuid":"254511552","full_name":"danclay/simple-dialogflow-client","owner":"danclay","description":"Integration of Dialogflow with Discord","archived":false,"fork":false,"pushed_at":"2023-03-16T08:17:48.000Z","size":687,"stargazers_count":6,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-21T23:17:44.024Z","etag":null,"topics":["bot","dialogflow","discord"],"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/danclay.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}},"created_at":"2020-04-10T00:59:39.000Z","updated_at":"2023-03-16T08:17:54.000Z","dependencies_parsed_at":"2023-07-17T00:49:39.788Z","dependency_job_id":null,"html_url":"https://github.com/danclay/simple-dialogflow-client","commit_stats":null,"previous_names":["danclay/discord-dialogflow"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/danclay/simple-dialogflow-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danclay%2Fsimple-dialogflow-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danclay%2Fsimple-dialogflow-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danclay%2Fsimple-dialogflow-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danclay%2Fsimple-dialogflow-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danclay","download_url":"https://codeload.github.com/danclay/simple-dialogflow-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danclay%2Fsimple-dialogflow-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29981481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T16:35:47.903Z","status":"ssl_error","status_checked_at":"2026-03-01T16:35:44.899Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["bot","dialogflow","discord"],"created_at":"2025-02-02T17:58:56.255Z","updated_at":"2026-03-01T19:34:19.261Z","avatar_url":"https://github.com/danclay.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://www.npmjs.com/package/@danclay/discord-dialogflow\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@danclay/discord-dialogflow.svg?cacheSeconds=3600\u0026style=flat-square\" alt=\"NPM version\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://raw.githubusercontent.com/danclay/discord-dialogflow/master/LICENSE\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/npm/l/@danclay/discord-dialogflow?style=flat-square\"\u003e\n    \u003ca href=\"https://david-dm.org/danclay/discord-dialogflow\"\u003e\u003cimg src=\"https://img.shields.io/david/danclay/discord-dialogflow.svg?cacheSeconds=3600\u0026style=flat-square\" alt=\"Dependencies\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://nodei.co/npm/@danclay/discord-dialogflow/\"\u003e\u003cimg src=\"https://nodeico.herokuapp.com/@danclay/discord-dialogflow.svg\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n### [Documentation](https://danclay.github.io/simple-dialogflow-client/)\n\n# About\n\nEasily integrate Dialogflow into your Discord bot (or other stuff) to allow for natural conversations. This should work with the message object for both Eris and discord.js\n\n# Installation (uses discord-dialogflow name still)\nRun `npm install @danclay/discord-dialogflow --save`\nor with yarn: `yarn add @danclay/discord-dialogflow`\n\n# Usage\n\n## Config\nTo configure the bot, use the `init(options)` function of this package. The options parameter is a object as follows:\n| Name           | Type    | Optional? | Default | Description                                                                                                                                  |\n|----------------|---------|-----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------|\n| projectID      | string  |           |         | GCP project ID                                                                                                                               |\n| keyPath        | string  |           |         | Absolute path to the GCP service account JSON key                                                                                            |\n| convertResult  | Boolean | Yes       | true    | If using a custom response payload and you want it to be given to you in JSON (if used this will be given in result.fulfillmentMessagesJSON) |\n| storeSessions  | Boolean | Yes       | true    | If you want sessions IDs to remain to same for specific users                                                                                |\n| sessionExpires | Number  | Yes       | 5       | How long until each session ID is deleted (only if options.storeSessions=true)                                                               |\n| easyMode       | Boolean | Yes       | false   | Enable basic mode where the callback will only have the fulfillment text                                                                     |\n| debug          | Boolean | Yes       | false   | Enable or disable debug logging                                                                                                              |\n\n## Getting a result\nTo get a result object from dialogflow, use the `getIntent(msg, callback)` function of this package. The parameters are as follows:\n### Parameters:\n| Name     | Type     | Description                                                    |\n|----------|----------|----------------------------------------------------------------|\n| msg      | Object   | message object (see below)                                     |\n| callback | callback | callback function (result object or string if using easy mode) |\n\n### Msg parameter:\n| Name      | Type   | Optional? | Description                                                                                   |\n|-----------|--------|-----------|-----------------------------------------------------------------------------------------------|\n| content   | string | Yes       | If not using a custom query, this will be used as the query text input                        |\n| author.id | Number | Yes       | If not using a custom query, this is needed for the ID                                        |\n| locale    | string | Yes       | message locale if you want it to not be English (only if no using custom query) (e.g.'en-US') |\n| query     | Object | Yes       | custom dialogflow query                                                                       |\n\n## Basics\n```javascript\nconst dialogflow = require('discord-dialogflow'); // requires the package\ndialogflow.init(\"project-id\", \"path-to-service-account-key.json\"); // init your project\ndialogflow.getIntent(msg, r =\u003e { // get the intent\n    // code using the results\n});\n```\n\n### Example using Eris and easy mode \n(as seen in [test/test.js](https://raw.githubusercontent.com/danclay/discord-dialogflow/master/test/test.js)):\n```javascript\nif (!(process.env.NODE_ENV === \"production\")) { // Use dotenv for local testing\n    require('dotenv').config();\n};\n\nconst Eris = require('eris');\n\nvar bot = new Eris(process.env.token);\nbot.on(\"ready\", () =\u003e {\n    console.log(\"Ready!\");\n});\n\n// Dialogflow\nconst dialogflow = require('../index.js'); // require the package (use the package name \"discord-dialogflow\" when you do it)\ndialogflow.init({\n    projectID: process.env.projectID,\n    keyPath: process.env.keyPath,\n    easyMode: true,\n    debug: true\n});\n\n\nbot.on(\"messageCreate\", async (msg) =\u003e {\n    if (!msg.author.bot) {\n        dialogflow.getIntent(msg, (r) =\u003e { // gets the intent and fallback text\n            bot.createMessage(msg.channel.id, r);\n        });\n    };\n});\nbot.connect();\n});\n```\n\n### Example using Eris and easy mode disabled:\n```javascript\nif (!(process.env.NODE_ENV === \"production\")) { // Use dotenv for local testing\n    require('dotenv').config();\n};\n\nconst Eris = require('eris');\n\nvar bot = new Eris(process.env.token);\nbot.on(\"ready\", () =\u003e {\n    console.log(\"Ready!\");\n});\n\n// Dialogflow\nconst dialogflow = require('../index.js'); // require the package (use the package name \"discord-dialogflow\" when you do it)\ndialogflow.init({\n    projectID: process.env.projectID,\n    keyPath: process.env.keyPath,\n    easyMode: false,\n    debug: true\n});\n\n\nbot.on(\"messageCreate\", async (msg) =\u003e {\n    if (!msg.author.bot) {\n        dialogflow.getIntent(msg, (r) =\u003e { // gets the intent and fallback text\n            console.log(JSON.stringify(r));\n            console.log(JSON.stringify(r.fulfillmentMessagesJSON[0].discord));\n            bot.createMessage(msg.channel.id, {embed: r.fulfillmentMessagesJSON[0].discord});\n        });\n    };\n});\nbot.connect();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanclay%2Fsimple-dialogflow-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanclay%2Fsimple-dialogflow-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanclay%2Fsimple-dialogflow-client/lists"}