Sha256: ec91d8933d824e4c3bae1b44c19b58446700e9228ca20742c1ead1c9b94afe09
Contents?: true
Size: 1.61 KB
Versions: 2
Compression:
Stored size: 1.61 KB
Contents
class SlackSmartBot #to send messages without listening for a response to users def send_msg_user(id_user, msg) unless msg == "" if id_user[0] == "D" if config[:simulate] open("#{config.path}/buffer_complete.log", "a") { |f| f.puts "|#{id_user}|#{config[:nick_id]}|#{config[:nick]}|#{msg}~~~" } else if Thread.current[:on_thread] client.message(channel: id_user, as_user: true, text: msg, thread_ts: Thread.current[:thread_ts]) else client.message(channel: id_user, as_user: true, text: msg) end end if config[:testing] and config.on_master_bot open("#{config.path}/buffer.log", "a") { |f| f.puts "|#{id_user}|#{config[:nick_id]}|#{config[:nick]}|#{msg}" } end else im = client.web_client.im_open(user: id_user) if config[:simulate] open("#{config.path}/buffer_complete.log", "a") { |f| f.puts "|#{im["channel"]["id"]}|#{config[:nick_id]}|#{config[:nick]}|#{msg}~~~" } else if Thread.current[:on_thread] client.message(channel: im["channel"]["id"], as_user: true, text: msg, thread_ts: Thread.current[:thread_ts]) else client.message(channel: im["channel"]["id"], as_user: true, text: msg) end end if config[:testing] and config.on_master_bot open("#{config.path}/buffer.log", "a") { |f| f.puts "|#{im["channel"]["id"]}|#{config[:nick_id]}|#{config[:nick]}|#{msg}" } end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
slack-smart-bot-1.9.2 | lib/slack/smart-bot/comm/send_msg_user.rb |
slack-smart-bot-1.9.1 | lib/slack/smart-bot/comm/send_msg_user.rb |