Giter Site home page Giter Site logo

dashbot's People

Contributors

amerritt avatar benjaminreinecke avatar dennis-dashbot avatar houjunchen avatar itozapata avatar jhullfly avatar mayrbenjamin92 avatar mgilangjanuar avatar ryanm2 avatar shotamakino avatar sinned avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dashbot's Issues

Error when using botkit-starter-facebook

Here's the error I get.

I'm curious why it would call the addTeamInfo method at all, looks like some Slack specific thing but I'm not integrating Slack at all, so that is confusing.

info: ERROR IN RECEIVE MIDDLEWARE:  TypeError: Cannot convert undefined or null to object
    at addTeamInfo (/home/joao/node-projects/make-me-fat-bot/node_modules/dashbot/src/dashbot.js:169:12)
    at Ware.DashBotSlack.that.receive (/home/joao/node-projects/make-me-fat-bot/node_modules/dashbot/src/dashbot.js:230:25)
    at Ware.<anonymous> (/home/joao/node-projects/make-me-fat-bot/node_modules/wrap-fn/index.js:45:19)
    at next (/home/joao/node-projects/make-me-fat-bot/node_modules/ware/lib/index.js:85:20)
    at Ware.run (/home/joao/node-projects/make-me-fat-bot/node_modules/ware/lib/index.js:88:3)
    at Object.Botkit.botkit.receiveMessage (/home/joao/node-projects/make-me-fat-bot/node_modules/botkit/lib/CoreBot.js:1067:35)
    at Object.Facebookbot.facebook_botkit.handleWebhookPayload (/home/joao/node-projects/make-me-fat-bot/node_modules/botkit/lib/Facebook.js:310:45)
    at /home/joao/node-projects/make-me-fat-bot/components/routes/incoming_webhooks.js:18:20
    at Layer.handle [as handle_request] (/home/joao/node-projects/make-me-fat-bot/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/joao/node-projects/make-me-fat-bot/node_modules/express/lib/router/route.js:131:13)
    at Route.dispatch (/home/joao/node-projects/make-me-fat-bot/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/joao/node-projects/make-me-fat-bot/node_modules/express/lib/router/layer.js:95:5)
    at /home/joao/node-projects/make-me-fat-bot/node_modules/express/lib/router/index.js:277:22
    at Function.process_params (/home/joao/node-projects/make-me-fat-bot/node_modules/express/lib/router/index.js:330:12)
    at next (/home/joao/node-projects/make-me-fat-bot/node_modules/express/lib/router/index.js:271:10)
    at serveStatic (/home/joao/node-projects/make-me-fat-bot/node_modules/serve-static/index.js:75:16)

Botkit middleware support for Facebook

Hi, I currently have a facebook chatbot using botkit and would like to integrate it with dashbot. So it will be great if botkit middleware support for facebook is in dashbot's future plan.

Update package-lock.json file to automatically remove the vulnerability

Hi, @shotamakino @jhullfly, I have reported a vulnerability issue in package google-p12-pem.

As far as I am aware, vulnerability(high severity) CVE-2020-7720 detected in package node-forge(<0.10.0) is directly referenced by  [email protected], on which your package [email protected] transitively depends. As such, this vulnerability can also affect [email protected] via the following path:
[email protected][email protected] ➔ @google-cloud/[email protected][email protected][email protected][email protected][email protected][email protected](vulnerable version)

Since google-p12-pem has released a new patched version [email protected] to resolve this issue ([email protected][email protected](fix version)), then this vulnerability patch can be automatically propagated into your project only if you update your package-lock.json file (delete package-lock.json and re-execute npm install command):
[email protected][email protected] ➔ @google-cloud/[email protected][email protected][email protected][email protected][email protected][email protected](vulnerability fix version).

Thank you for your attention to this issue.^_^

Add a LICENSE file

For certain enterprise purposes a link to a LICENSE file for a project is required, so it would be great if a LICENSE file was available in the repo to be linked to.

Cannot read property '$isSingleNested' of undefined

I suspect this is an issue with dashbot. I've been using version 0.6.2.
With the latest version (0.7.3) I get the following error:

info: ERROR IN RECEIVE MIDDLEWARE: TypeError: Cannot read property '$isSingleNested' of undefined

Require individual Lodash Modules instead of the Full Lodash library

Reduce the size of the required packages.

Instead of:
require('lodash')

Use a require for the individual functions needed:
require('lodash.get')
...

Here is a list of all lodash function used in this project:

  • assign
  • clone
  • cloneDeep
  • each
  • find
  • get
  • has
  • indexOf
  • isArray
  • isArray
  • isFunction
  • isObject
  • isObjectLike
  • isString
  • map
  • merge
  • set

Bot Framework Emulator

My problem:

**** Warning: No Dashbot apiKey for platform:(emulator) Data not saved.

My code:

var dashbotApiMap = {
    //put keys like Facebook...
};

// DashBotMicrosoft(apiKeyMap, urlRoot, debug, printErrors, config)
const dashbot = require('dashbot')(dashbotApiMap, {debug: true}).microsoft;
bot.use(dashbot);

Initial conditions:

  • I use Microsoft Bot Builder
  • I have hosted my bot on Azure (I want to test the new code without deploy it online and use the Emulator).

With theses conditions, the Dashbot doesn't allow me use the Emulator's platform and doesn't log the messages.

Could you allow to use this platform for the Microsoft integration?

Error with Botkit 4.6.2 (facebook)

Because new version of Botkit used FacebookAdapter, please update!

function botkitTransformOutgoing(bot, message) {

        var sendMessage = _.cloneDeep(message);
        var channel = getAndRemove(sendMessage, 'channel');

        console.log(sendMessage);

        return {
            qs: {
                access_token: bot.botkit.config.access_token !!!!BUG HERE
            },
            json: {
                recipient: {
                    id: channel
                },
                message: sendMessage
            }
        };
    }

Add support for conv.followup() in dashbot-google

When conv.followup() is used in the actions-on-google dialogflow library the following error occurs:

"validation error: {"success":false,"errors":[{"message":"at least one of [items[0].simpleResponse.displayText or speech or expectedInputs[0].inputPrompt.initialPrompts[0].ssml or expectedInputs[0].inputPrompt.initialPrompts[0].textToSpeech or richResponse.items[0].simpleResponse.displayText or richResponse.items[0].simpleResponse.ssml or expectedInputs[0].inputPrompt.richInitialPrompt.items[0].simpleResponse.textToSpeech or finalResponse.speechResponse.textToSpeech or fulfillmentText or data.google.richResponse.items[0].simpleResponse.displayText or data.google.richResponse.items[0].simpleResponse.ssml or data.google.richResponse.items[0].simpleResponse.textToSpeech or payload.google.richResponse.items[0].simpleResponse.textToSpeech or payload.google.richResponse.items[0].simpleResponse.displayText or payload.google.richResponse.items[1].simpleResponse.textToSpeech or payload.google.richResponse.items[1].simpleResponse.displayText or fulfillmentMessages[0].simpleResponses.simpleResponses[0].textToSpeech or fulfillmentMessages[0].simpleResponses.simpleResponses[0].displayText] needs to be present in post body"}]}"

I can hide this error using the printErrors = false configuration but it would be best if followup events were handled natively

validation error: {"success":false,"errors":[{"message":"unknown 'apiKey'"}]}

I'm working with Bot Framework on my local host and interacting with Bot Framework Emulator

My code is:

const dashbot = require('dashbot')({apiKey: process.env.DASHBOT_KEY, debug: true}).generic;
[...]
// MIDDLEWARE to handle the inputs & outputs
[...]
const messageForDashbot = {
    "text": session.text, // text's message from session object
    "userId": "demo"
};
dashbot.logOutgoing(messageForDashbot);
[...]
const messageForDashbot = {
    "text": session.text,
    "userId": "demo"            
};
dashbot.logIncoming(messageForDashbot);
[...]

screen shot on mar 12th at 04_23 pm

I've checked:

  • Dashbot key on Dashbot's dashboard (above there is a photo) and environment variable
  • JSON of object session.text

But when I debug my code on my localhost Emulator, Dashbot's debbuger send me:

validation error: {"success":false,"errors":[{"message":"unknown 'apiKey'"}]}

What's the error?

generic (universal) bot (sdk) not working well with version 11.0.0?

I have attempted to upgrade to version 11.0.0 of Dashbot without making any code changes in my nodejs software (using Dashbot's node sdk). However, when inspecting the live transcripts for the bot conversations, I see that the json produced when calling 'dashbot.logOutgoing' is as follows:
{“userId”: “myuser”,
“validation”: {
“success”: false,
“errors”: [
{“message”: “invalid version ’11.0.1’”}
]
},
“text”: “Some bot text here…”
}

Also, incoming messages do not appear to be logged at all (probably some other error message but it is not showing up anywhere).
Does version 11.0.0 have different coding requirements than previous versions? Please advise.

Slack bot Team name

In dropdown on report page on webapp I can see only IDs of teams that are using my bot on Slack. I do not see name that is associated with that team. However I am sending full information about team, both "id" and "name" field.

Any hints about this?

EDIT: I am using native requests implemented in ASP.NET

Regards,
Aleksandar

BotKit and Facebook - [Unsupported Message Type]

dashbot - 9.9.0
botkit - 0.6.12

In Dashbot, there are 3+ [Unsupported Message Type] message appearing for each message sent to user. Botkit is configured to receive delivery messages (see below)

let
  controller = Botkit.facebookbot({
    access_token: FACEBOOK.pageAccessToken,
    verify_token: FACEBOOK.validationToken,
    app_secret: FACEBOOK.appSecret,
    validate_requests: FACEBOOK.validateRequests,
    require_delivery: true,
    receive_via_postback: true // postback payload returned in message_received
  }),
  bot = controller.spawn({})
;

The JSON for the messages in Dashbot are:

{
  "type": "message_delivered"
}
// and
{
  "type": "message_read"
}

Suggested Fixes:

  1. Dashbot API should ignore these message types
  2. Update the code to skip sending for these message types (maybe in logIncomingInternal)
    function logIncomingInternal(data, source, type) {
    )
  3. Update documentation to show users how to do it
controller.middleware.receive.use((bot, message, next) => {
    if (message && !['message_read','message_delivered'].includes(message.type)) {
      dashbot.send(bot, message, next);
    }
});

logIncoming method produces unhandled promised rejections during request timeouts

The logIncoming method sometimes times out trying to send data to Dashbot. This unfortunately causes an exception that is thrown and is uncaught within it, which in turn may cause the containing node application to eventually exit with a non-zero error code (as unhandled promised rejections will eventually be deprecated). Note that it's of no use to wrap the call to this method with a try/catch block.

TypeError: Converting circular structure to JSON with Alexa Lambda Integration

I have followed instruction here https://www.dashbot.io/docs/alexa/lambdav2/
but got an error:

TypeError: Converting circular structure to JSON
at JSON.stringify ()
at module.exports (/internet-archive-google-action/functions/node_modules/dashbot/src/make-request.js:13:16)
at internalLogIncoming (/internet-archive-google-action/functions/node_modules/dashbot/src/dashbot-amazon-alexa.js:23:12)
at DashBotBase.DashBotAmazonAlexa.that.logIncoming (/internet-archive-google-action/functions/node_modules/dashbot/src/dashbot-amazon-alexa.js:51:12)
at Object.setupAspectJoinpoint (/internet-archive-google-action/functions/node_modules/dashbot/src/dashbot-amazon-alexa.js:151:32)
at callAround (/internet-archive-google-action/functions/node_modules/meld/meld.js:242:20)
at callNext (/internet-archive-google-action/functions/node_modules/meld/meld.js:221:8)
at Advisor._callAroundAdvice (/internet-archive-google-action/functions/node_modules/meld/meld.js:290:11)
at Object.Advisor.advised.advised [as handler] (/internet-archive-google-action/functions/node_modules/meld/meld.js:130:33)
at LambdaServer.invoke (/internet-archive-google-action/functions/node_modules/bespoken-tools/lib/client/lambda-server.js:94:52)

So as you can see it comes from Alexa and I've found that LambdaContext has a lot of circular properties. I have used util.inspect(context, {depth: 5})).

Project dead?

Hi guys - is this project still alive and actively maintained? There are a couple of very old pull requests and the project uses, meanwhile, older versions of libraries with known security vulnerabilities.

Any chance to get an answer?

Best regards,
Benni

Allow filtering sensitive info from messages logged

Would be nice to support some sort of method to redact sensitive info from logging. Essentially some intermediate hook where a function could be supplied to modify the data before it goes to dashbot can accomplish this and more.

Getting this gRPC error when deploying dashbot to lambda Node 12.x

{
    "errorType": "Runtime.ImportModuleError",
    "errorMessage": "Error: Failed to load gRPC binary module because it was not installed for the current system\nExpected directory: node-v64-linux-x64-glibc\nFound: [node-v57-linux-x64-glibc]\nThis problem can often be fixed by running \"npm rebuild\" on the current system\nOriginal error: Cannot find module '/var/task/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node'",
    "stack": [
        "Runtime.ImportModuleError: Error: Failed to load gRPC binary module because it was not installed for the current system",
        "Expected directory: node-v64-linux-x64-glibc",
        "Found: [node-v57-linux-x64-glibc]",
        "This problem can often be fixed by running \"npm rebuild\" on the current system",
        "Original error: Cannot find module '/var/task/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node'",
        "    at _loadUserApp (/var/runtime/UserFunction.js:100:13)",
        "    at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)",
        "    at Object.<anonymous> (/var/runtime/index.js:45:30)",
        "    at Module._compile (internal/modules/cjs/loader.js:778:30)",
        "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)",
        "    at Module.load (internal/modules/cjs/loader.js:653:32)",
        "    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)",
        "    at Function.Module._load (internal/modules/cjs/loader.js:585:3)",
        "    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)",
        "    at startup (internal/bootstrap/node.js:283:19)"
    ]
}

Resolved by using npm install grpc --target=8.1.0 --target_arch=x64 --target_platform=linux --target_libc=glibc

and setting lambda runtime to 10.x
but bundle size became too heavy because of the above command.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.