Giter Site home page Giter Site logo

Comments (8)

ZuzooVn avatar ZuzooVn commented on July 30, 2024 3

@gdcohan Finally I can get the attachments content with below code:

controller.on('bot_message', function(bot, message) {
    console.log('message.attachments: ' + message.attachments);
    var attachment = message.attachments[0];
    console.log('attachments.title: ' + attachment.title);
    console.log('attachments.text: ' + attachment.text);
});```

from botkit.

ZuzooVn avatar ZuzooVn commented on July 30, 2024

Finally I can use bot_message event

controller.on('bot_message', function(bot, message) {
    // Do something here
});

from botkit.

ZuzooVn avatar ZuzooVn commented on July 30, 2024

There was a problems that message.text always return null.

from botkit.

gdcohan avatar gdcohan commented on July 30, 2024

@ZuzooVn I was hitting this problem too..in my case, the bot was sending a message that had no text but an attachment field with a fallback in it..maybe yours is doing something like this too?

from botkit.

ZuzooVn avatar ZuzooVn commented on July 30, 2024

@gdcohan Me too, we can not get the text because the bot did not send any text. Can you get the text in the attachment in below image?

screen shot 2015-12-28 at 4 51 16 pm

from botkit.

ZuzooVn avatar ZuzooVn commented on July 30, 2024

@gdcohan According to https://api.slack.com/events/message/bot_message, I think we can not get the attachments content.

from botkit.

donavon avatar donavon commented on July 30, 2024

Did bot_message go away? I don't see it anywhere in the code and it's not fired when I receive a message from another bot.

from botkit.

kalexmills avatar kalexmills commented on July 30, 2024

@donavon The above code snippet works for me.

from botkit.

Related Issues (20)

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.