Skip to content

BotKit and Facebook - [Unsupported Message Type] #24

@jsalwen

Description

@jsalwen

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);
    }
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions