-
-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a note concerning replying in a thread #168
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,6 +106,23 @@ end | |
|
||
Operator match data includes `match['operator']` and `match['expression']`. The `bot` match always checks against the `SlackRubyBot::Config.user` setting. | ||
|
||
### Threaded Messages | ||
|
||
You can reply to a message in a thread (or keep sending to the current thread) : | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpick: why a space before |
||
|
||
```ruby | ||
command 'reply in thread' do |client, data, match| | ||
client.say( | ||
channel: data.channel, | ||
text: "let's avoid spamming everyone, I will tell you what you need in this thread", | ||
thread_ts: data.thread_ts || data.ts | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a comment to what these are? Maybe a link to docs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello sorry for the long wait. I'm a French guy so sometimes I forget there is no space before semicolons in english ^^" I have included extra information and links regarding Sorry for stalling this PR for so long |
||
) | ||
end | ||
``` | ||
Note that using only `thread_ts: data.ts` can cause some permanent issues where Slack will keep reporting inaccessible messages as unread. As recommended by the slack documentation, the replies to a thread should always be sent to message `ts` that started the thread, available as `thread_ts` for subsequent messages. Hence `data.thread_ts || data.ts`. | ||
|
||
For additional options including broadcasting, refer to [slack-ruby-client#chat_postMessage](https://github.com/slack-ruby/slack-ruby-client/blob/41539c647ac877400f20aa338aa42d2ebfd2866b/lib/slack/web/api/endpoints/chat.rb#L105) | ||
|
||
### Bot Aliases | ||
|
||
A bot will always respond to its name (eg. `rubybot`) and Slack ID (eg. `@rubybot`), but you can specify multiple aliases via the `SLACK_RUBY_BOT_ALIASES` environment variable or via an explicit configuration. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should have it's own section, like
### Threaded Messages