Giter Site home page Giter Site logo

Comments (4)

stevengill avatar stevengill commented on June 16, 2024

Question, How do you know know a thread is complete? Do you want to respond to every message in the thread? Will there be like a emoji or some other means to indicate that your app should run? Are you going to do it time based?

from hubot-slack.

miltlima avatar miltlima commented on June 16, 2024

hello @stevengill, I just want to reply to the last message, in this case it is a link, when the user clicks on a react emoji, the hubot will take the last sentence of the thread and put in a variable

from hubot-slack.

seratch avatar seratch commented on June 16, 2024

@miltlima How about doing like this? I haven't verified if it actually works but doing similar should work for you.

  # listen to all incoming messages
  robot.hear /.*/, (res) ->
    if res.message.thread_ts?
      # do something here

The above code example is a combination of examples in this document: https://slack.dev/hubot-slack/basic_usage Refer to the document for more information.

from hubot-slack.

miltlima avatar miltlima commented on June 16, 2024

Thanks @seratch for explanation !

I used a Slack API response function with an index for the 3rd thread message and solved

const replies = await app.conversations.replies({
        channel: msg.message.item.channel,
        ts: msg.message.item.ts
      })
      const infoUrl = await getInfoFromUrl(replies.messages[2].text);```

from hubot-slack.

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.