module Boty module Slack class IM include Slack::URL url "https://slack.com/api/im" def open(user, parameters = {}) defaults = { user: user } url = parameterize defaults.merge(parameters), path: ".open" info = URL.get(url) || {} Slack::Channel.new id: Hash(info["channel"])["id"], info: info end end end end