lib/ruboty/slack_rtm/client.rb in ruboty-slack_rtm-2.7.1 vs lib/ruboty/slack_rtm/client.rb in ruboty-slack_rtm-2.7.2
- old
+ new
@@ -10,10 +10,10 @@
@queue = Queue.new
@client = create_client(websocket_url.to_s)
end
def send_message(data)
- data[:id] = Time.now.to_i * 10 + rand(10)
+ data[:id] = (Time.now.to_i * 10 + rand(10)) % (1 << 31)
@queue.enq(data.to_json)
end
def on_text(&block)
@client.on(:message) do |message|