Sha256: c8d4456fd4f6731a3a314ee0b35f361ed1332e46a4a4da29a2f8f2f5cd4c553b

Contents?: true

Size: 990 Bytes

Versions: 17

Compression:

Stored size: 990 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: command_id: :see_repls
  # 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 (is_admin?(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

17 entries across 17 versions & 1 rubygems

Version Path
slack-smart-bot-1.14.2 lib/slack/smart-bot/commands/on_bot/see_repls.rb
slack-smart-bot-1.14.1 lib/slack/smart-bot/commands/on_bot/see_repls.rb
slack-smart-bot-1.14.0 lib/slack/smart-bot/commands/on_bot/see_repls.rb
slack-smart-bot-1.13.2 lib/slack/smart-bot/commands/on_bot/see_repls.rb
slack-smart-bot-1.13.1 lib/slack/smart-bot/commands/on_bot/see_repls.rb
slack-smart-bot-1.13.0 lib/slack/smart-bot/commands/on_bot/see_repls.rb
slack-smart-bot-1.12.9 lib/slack/smart-bot/commands/on_bot/see_repls.rb
slack-smart-bot-1.12.8 lib/slack/smart-bot/commands/on_bot/see_repls.rb
slack-smart-bot-1.12.7 lib/slack/smart-bot/commands/on_bot/see_repls.rb
slack-smart-bot-1.12.6 lib/slack/smart-bot/commands/on_bot/see_repls.rb
slack-smart-bot-1.12.5 lib/slack/smart-bot/commands/on_bot/see_repls.rb
slack-smart-bot-1.12.4 lib/slack/smart-bot/commands/on_bot/see_repls.rb
slack-smart-bot-1.12.3 lib/slack/smart-bot/commands/on_bot/see_repls.rb
slack-smart-bot-1.12.2 lib/slack/smart-bot/commands/on_bot/see_repls.rb
slack-smart-bot-1.12.1 lib/slack/smart-bot/commands/on_bot/see_repls.rb
slack-smart-bot-1.12.0 lib/slack/smart-bot/commands/on_bot/see_repls.rb
slack-smart-bot-1.11.0 lib/slack/smart-bot/commands/on_bot/see_repls.rb