Sha256: c9850b954d9eeb27960323825530d97471b0a8f1b842ba5cf0942cf3f90bb49a

Contents?: true

Size: 1.52 KB

Versions: 17

Compression:

Stored size: 1.52 KB

Contents

class SlackSmartBot
  # help: ----------------------------------------------
  # help: `stop using rules from CHANNEL`
  # help:    it will stop using the rules from the specified channel.
  # help:
  def stop_using_rules(dest, channel, user, dchannel)
    save_stats(__method__)
    if @channels_id.key?(channel)
      channel_id = @channels_id[channel]
    else
      channel_id = channel
    end

    if dest[0] == "C" or dest[0] == "G" #channel
      if @rules_imported.key?(user.id) and @rules_imported[user.id].key?(dchannel)
        if @rules_imported[user.id][dchannel] != channel_id
          respond "You are not using those rules.", dest
        else
          @rules_imported[user.id].delete(dchannel)
          update_rules_imported()
          respond "You won't be using those rules from now on.", dest

          def git_project() "" end
          def project_folder() "" end
        end
      else
        respond "You were not using those rules.", dest
      end
    else #direct message
      if @rules_imported.key?(user.id) and @rules_imported[user.id].key?(user.id)
        if @rules_imported[user.id][user.id] != channel_id
          respond "You are not using those rules.", dest
        else
          @rules_imported[user.id].delete(user.id)
          update_rules_imported()
          respond "You won't be using those rules from now on.", dest

          def git_project() "" end
          def project_folder() "" end
        end
      else
        respond "You were not using those rules.", dest
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
slack-smart-bot-1.9.2 lib/slack/smart-bot/commands/general/stop_using_rules.rb
slack-smart-bot-1.9.1 lib/slack/smart-bot/commands/general/stop_using_rules.rb
slack-smart-bot-1.8.2 lib/slack/smart-bot/commands/general/stop_using_rules.rb
slack-smart-bot-1.8.1 lib/slack/smart-bot/commands/general/stop_using_rules.rb
slack-smart-bot-1.8.0 lib/slack/smart-bot/commands/general/stop_using_rules.rb
slack-smart-bot-1.7.0 lib/slack/smart-bot/commands/general/stop_using_rules.rb
slack-smart-bot-1.6.8 lib/slack/smart-bot/commands/general/stop_using_rules.rb
slack-smart-bot-1.6.7 lib/slack/smart-bot/commands/general/stop_using_rules.rb
slack-smart-bot-1.6.6 lib/slack/smart-bot/commands/general/stop_using_rules.rb
slack-smart-bot-1.6.5 lib/slack/smart-bot/commands/general/stop_using_rules.rb
slack-smart-bot-1.6.4 lib/slack/smart-bot/commands/general/stop_using_rules.rb
slack-smart-bot-1.6.3 lib/slack/smart-bot/commands/general/stop_using_rules.rb
slack-smart-bot-1.6.2 lib/slack/smart-bot/commands/general/stop_using_rules.rb
slack-smart-bot-1.6.1 lib/slack/smart-bot/commands/general/stop_using_rules.rb
slack-smart-bot-1.6.0 lib/slack/smart-bot/commands/general/stop_using_rules.rb
slack-smart-bot-1.5.1 lib/slack/smart-bot/commands/general/stop_using_rules.rb
slack-smart-bot-1.5.0 lib/slack/smart-bot/commands/general/stop_using_rules.rb