class Slack::CLI::App

Public Instance Methods

export(channel_id) click to toggle source
# File lib/slack/cli/app.rb, line 31
def export(channel_id)
  args = options.merge(channel: channel_id)

  if args.key?(:oldest)
    parse_slack_timestamp(args[:oldest])
  end

  if args.key?(:latest)
    args[:latest] = parse_slack_timestamp(args[:latest])
  end

  case channel_id
  when /^C/
    puts client.channels.history(args)
  when /^D/
    puts client.im.history(args)
  else
    fail ArgumentError, "Unknown channel format (got `#{channel_id}')"
  end
end