Sha256: 9c74aef944af732e15cdfba800b456bfdd93346a474097080754100934783e25

Contents?: true

Size: 671 Bytes

Versions: 17

Compression:

Stored size: 671 Bytes

Contents

class SlackSmartBot

  def get_channels_name_and_id
    @channels_list = get_channels()
    @channels_id = Hash.new()
    @channels_name = Hash.new()
    @channels_creator = Hash.new()
    @users = get_users() if @users.empty?
    @channels_list.each do |ch|
      unless ch.is_archived
        @channels_id[ch.name] = ch.id
        @channels_name[ch.id] = ch.name
        user_info = @users.select{|u| u.id == ch.creator or (u.key?(:enterprise_user) and u.enterprise_user.id == ch.creator)}[-1]
        @channels_creator[ch.id] = user_info.name unless user_info.nil?
        @channels_creator[ch.name] = user_info.name unless user_info.nil?
      end
    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/utils/get_channels_name_and_id.rb
slack-smart-bot-1.14.1 lib/slack/smart-bot/utils/get_channels_name_and_id.rb
slack-smart-bot-1.14.0 lib/slack/smart-bot/utils/get_channels_name_and_id.rb
slack-smart-bot-1.13.2 lib/slack/smart-bot/utils/get_channels_name_and_id.rb
slack-smart-bot-1.13.1 lib/slack/smart-bot/utils/get_channels_name_and_id.rb
slack-smart-bot-1.13.0 lib/slack/smart-bot/utils/get_channels_name_and_id.rb
slack-smart-bot-1.12.9 lib/slack/smart-bot/utils/get_channels_name_and_id.rb
slack-smart-bot-1.12.8 lib/slack/smart-bot/utils/get_channels_name_and_id.rb
slack-smart-bot-1.12.7 lib/slack/smart-bot/utils/get_channels_name_and_id.rb
slack-smart-bot-1.12.6 lib/slack/smart-bot/utils/get_channels_name_and_id.rb
slack-smart-bot-1.12.5 lib/slack/smart-bot/utils/get_channels_name_and_id.rb
slack-smart-bot-1.12.4 lib/slack/smart-bot/utils/get_channels_name_and_id.rb
slack-smart-bot-1.12.3 lib/slack/smart-bot/utils/get_channels_name_and_id.rb
slack-smart-bot-1.12.2 lib/slack/smart-bot/utils/get_channels_name_and_id.rb
slack-smart-bot-1.12.1 lib/slack/smart-bot/utils/get_channels_name_and_id.rb
slack-smart-bot-1.12.0 lib/slack/smart-bot/utils/get_channels_name_and_id.rb
slack-smart-bot-1.11.0 lib/slack/smart-bot/utils/get_channels_name_and_id.rb