lib/slack/smart-bot/comm/respond.rb in slack-smart-bot-1.4.3 vs lib/slack/smart-bot/comm/respond.rb in slack-smart-bot-1.5.0
- old
+ new
@@ -8,11 +8,15 @@
if config[:simulate]
open("#{config.path}/buffer_complete.log", "a") { |f|
f.puts "|#{@channel_id}|#{config[:nick_id]}|#{msg}~~~"
}
else
- client.message(channel: @channel_id, text: msg, as_user: true)
+ if Thread.current[:on_thread]
+ client.message(channel: @channel_id, text: msg, as_user: true, thread_ts: Thread.current[:thread_ts])
+ else
+ client.message(channel: @channel_id, text: msg, as_user: true)
+ end
end
if config[:testing] and config.on_master_bot
open("#{config.path}/buffer.log", "a") { |f|
f.puts "|#{@channel_id}|#{config[:nick_id]}|#{msg}"
}
@@ -21,10 +25,14 @@
if config[:simulate]
open("#{config.path}/buffer_complete.log", "a") { |f|
f.puts "|#{dest}|#{config[:nick_id]}|#{msg}~~~"
}
else
- client.message(channel: dest, text: msg, as_user: true)
+ if Thread.current[:on_thread]
+ client.message(channel: dest, text: msg, as_user: true, thread_ts: Thread.current[:thread_ts])
+ else
+ client.message(channel: dest, text: msg, as_user: true)
+ end
end
if config[:testing] and config.on_master_bot
open("#{config.path}/buffer.log", "a") { |f|
f.puts "|#{dest}|#{config[:nick_id]}|#{msg}"
}