Shouldn't "say()" automatically handle threads?
See original GitHub issueDescription
A user triggers activity within a thread, but the bot, using say()
responds to the main conversation.
At worst, say()
should accept parameters that would allow me to chose whether response should be in a thread or the main conversation. At best, say()
should automatically respond in the thread, while still providing parameters to control automatic respond-in-thread and also-post-to-channel.
What type of issue is this? (place an x
in one of the [ ]
)
- bug
- enhancement (feature request)
- question
- documentation related
- testing related
- discussion
Requirements (place an x
in each of the [ ]
)
- I’ve read and understood the Contributing guidelines and have done my best effort to follow them.
- I’ve read and agree to the Code of Conduct.
- I’ve searched for any related issues and avoided creating a duplicate issue.
Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
package version: v2.1.1
node version: v12
OS version(s): Alpine Linux (docker container)
Steps to reproduce:
- Write a handler such as this:
// respond to ping message
app.message(directMention(), /PING$/i, ({ message, say }) => {
console.debug(JSON.stringify(message));
say('PONG');
});
- Have someone say this in a thread:
@botname PING
- See bot respond outside of the thread
PONG
Expected result:
If a user is @ mentioning the bot within a thread, I would expect the provided “say()” function to respond within that thread
Actual result:
Bot responded to thread in main conversation
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Top 20 C++ multithreading mistakes and how to avoid them
Mistake # 1: Not using join() to wait for background threads before ... ( UI thread handling rendering) can cause the application to...
Read more >Java Concurrency issues and Thread Synchronization
Whenever any thread modifies a shared variable, it automatically establishes a happens-before relationship with subsequent reads and writes of ...
Read more >(Not) using std::thread | Andrzej's C++ blog
This post is about std::thread but not about threads or multi-threading. This is not an introduction to C++ threads.
Read more >What happens if you call exit(0) while other threads are still ...
Technically SIGTERM handler shouldn't kill the threads. ... The thread class handles the stop() and that can happen in its destructor:
Read more >Thread.Sleep is a sign of a poorly designed program.
Thread.Sleep has been used for many things it shouldn't be used for. ... I use thread.sleep() while flashing an embbedded controller.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @iancward
I chatted with the team and it seems this is already possible with
say
. You need to provide thethread_ts
argument when calling it.You can find out more about
thread_ts
at https://api.slack.com/methods/chat.postMessage#arg_thread_tsLet me know if this works for you.
We aren’t going to change the default behaviour of
say
to respond to threads first. If you are interested in a more reusable solution for responding to threads, I can suggest a middleware based solution. Let me know.Hey @iancward
Thanks for reporting this! I think you are correct that
say
doesn’t currently support this. It is worth looking into adding this support I think. We will get back to you after some investigation and discussion with the other maintainers.