Sha256: 669cce39d17158125749857b6514fcbcbd7565eece8f3b0207e81f3d55955f16

Contents?: true

Size: 970 Bytes

Versions: 1

Compression:

Stored size: 970 Bytes

Contents

class SlackSmartBot
  # help: ----------------------------------------------
  # help: `see repls`
  # help: `see irbs`
  # help:     It will display the repls
  # help:     <https://github.com/MarioRuiz/slack-smart-bot#repl|more info>
  # help:
  def see_repls(dest, user, typem)
    #todo: add tests
    save_stats(__method__)
    from = user.name
    if has_access?(__method__, user)
      message = ""
      @repls.sort.to_h.each do |session_name, repl|
        if (repl.creator_name == user.name or repl.type == :public or repl.type == :public_clean) or (config.admins.include?(user.name) and typem == :on_dm)
          message += "(#{repl.type}) *#{session_name}*: #{repl.description} / created: #{repl.created} / accessed: #{repl.accessed} / creator: #{repl.creator_name} / runs: #{repl.runs_by_creator+repl.runs_by_others} / gets: #{repl.gets} \n"
        end
      end
      message = "No repls created" if message == ''
      respond message
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
slack-smart-bot-1.10.0 lib/slack/smart-bot/commands/on_bot/see_repls.rb