{"action":"created","comment":{"url":"https://api.github.com/repos/jayson/SlackCat/pulls/comments/44873195","id":44873195,"diff_hunk":"@@ -3,87 +3,67 @@\n require 'open3'\n \n slackcat = Cinch::SlackBot.new do\n-  if (File.exist?(\".config\"))\n-    @slack_config = JSON.parse(File.read(\".config\"))\n-  else \n-    @slack_config = []\n-    File.write(\".config\", \"{}\")\n-  end\n+    if (File.exist?(\".config\"))\n+        @slack_config = JSON.parse(File.read(\".config\"))\n+    else \n+        @slack_config = []\n+        File.write(\".config\", \"{}\")\n+    end\n \n-  set_config :ssl\n-  set_config :user\n-  set_config :nick, \"slackcat\"\n-  set_config :user\n-  set_config :password\n-  set_config :server\n-  set_config :port, 6667\n-  load_plugins\n+    set_config :ssl, true\n+    set_config :nick, \"travisbot\"\n+    set_config :user, \"travisbot\"\n+    set_config :password\n+    set_config :server, \"roguesquadron.irc.slack.com\"\n+    set_config :port, 6697\n+    #set_config :plugins, ([\"leaderboard\"].to_s)\n \n-  # Helpers\n-  helpers do \n-    def save_config\n-      File.write(\".config\", JSON.pretty_generate(bot.get_slack_config, quirks_mode: true))\n-    end\n+    #info(\"password: \" + password)\n \n-    def load_config\n-      @slack_config = JSON.parse(File.read(\".config\"))\n-    end\n-  end\n+    load_plugins\n+\n+    # Helpers\n+    helpers do \n+        def save_config\n+            File.write(\".config\", JSON.pretty_generate(bot.get_slack_config, quirks_mode: true))\n+        end\n \n-  # Base slack bot commands\n-  command /join (.+)/ do |message, channel|\n-    info(\"Joining channel #{channel}\")\n-    bot.join(channel)\n-    channels = bot.get_slack_config(\"channels\")\n-    channels.unshift channel\n-    bot.set_slack_config(\"channels\", channels)\n-    save_config\n-  end\n+        def load_config\n+            @slack_config = JSON.parse(File.read(\".config\"))\n+        end\n+    end\n \n-  command /part(?: (.+))?/ do |message, channel|\n-    # Part current channel if none is given\n-    channel = channel || message.channel\n+    # on :message, \"/^([a-zA-Z]+)\\+\\+\" do |m|\n+    on :message, \"hello\" do |m|\n+        info(\"trying the on :message!\")\n+        m.reply \"got an '#{m.raw}' message!\"\n+    end\n \n-    if channel\n-      info(\"Parting channel #{channel}\")\n-      bot.part(channel)\n-      channels = bot.get_slack_config(\"channels\")\n-      channels.delete_if { |key, value| value == channel }\n-      bot.set_slack_config(\"channels\", channels)\n-      save_config\n-    else\n-      info(\"No such channel to part #{channel}\") \n+    on :message, /;join (.+)/ do |m|\n+        channel = m.message.split(\" \")[1]\n+        info(\"trying to join channel: #{channel}\")\n+        bot.join(channel)\n     end\n-  end\n \n-  command /reload/ do |message|\n-    load_config\n-    @slack_config = JSON.parse(File.read(\".config\"))\n-    @slack_config[\"channels\"].each do |channel| \n-      bot.join(channel)\n+    on :message, /;part (.+)/ do |m|\n+        channel = m.message.split(\" \")[1]\n+        info(\"trying to part channel: #{channel}\")\n+        bot.part(channel)\n     end\n-  end\n \n-  command /source/ do |message|\n-    message.reply \"https://github.com/jayson/SlackCat\"\n-  end\n+    #on :message, /[a-zA-Z\\.]\\+\\+$/ do |m|\n+    #    name = m.message.split(\"+\")[0]\n+    #    info(\"incrementing '#{name}'\")\n+    #    m.reply \"incremeting '#{name}'! - suck it jpaul\"\n+    #end\n+\n+    #on :message, /[a-zA-Z\\.]--$/ do |m|\n+    #    name = m.message.split(\"-\")[0]\n+    #    info(\"decrementing'#{name}'\")\n+    #    m.reply \"decrementing '#{name}'! - suck it jpaul\"\n+    #end\n \n-  command /gitup/ do |message|\n-    cmd = \"git pull\"\n \n-    puts cmd\n-    Open3.popen3(cmd) do |inn, out, err, wait_thr|\n-      output = \"\"\n-      until out.eof?\n-        # raise \"Timeout\" if output.empty? && Time.now.to_i - start > 300\n-        chr = out.read(1)\n-        output << chr\n-      end\n-      error_message = nil\n-      error_message = err.read unless err.eof?\n-      message.reply(\"#{output} #{error_message}\")\n-    end\n-  end","path":"slackcat.rb","position":133,"original_position":133,"commit_id":"ed2111039722f40b057bc302bdc8a707ab64b135","original_commit_id":"ed2111039722f40b057bc302bdc8a707ab64b135","user":{"login":"benjamincudi","id":3100291,"avatar_url":"https://avatars.githubusercontent.com/u/3100291?v=3","gravatar_id":"","url":"https://api.github.com/users/benjamincudi","html_url":"https://github.com/benjamincudi","followers_url":"https://api.github.com/users/benjamincudi/followers","following_url":"https://api.github.com/users/benjamincudi/following{/other_user}","gists_url":"https://api.github.com/users/benjamincudi/gists{/gist_id}","starred_url":"https://api.github.com/users/benjamincudi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjamincudi/subscriptions","organizations_url":"https://api.github.com/users/benjamincudi/orgs","repos_url":"https://api.github.com/users/benjamincudi/repos","events_url":"https://api.github.com/users/benjamincudi/events{/privacy}","received_events_url":"https://api.github.com/users/benjamincudi/received_events","type":"User","site_admin":false},"body":"Another arbitrarily removed function?","created_at":"2015-11-15T15:48:23Z","updated_at":"2015-11-15T15:48:23Z","html_url":"https://github.com/jayson/SlackCat/pull/2#discussion_r44873195","pull_request_url":"https://api.github.com/repos/jayson/SlackCat/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/jayson/SlackCat/pulls/comments/44873195"},"html":{"href":"https://github.com/jayson/SlackCat/pull/2#discussion_r44873195"},"pull_request":{"href":"https://api.github.com/repos/jayson/SlackCat/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/jayson/SlackCat/pulls/2","id":50728783,"html_url":"https://github.com/jayson/SlackCat/pull/2","diff_url":"https://github.com/jayson/SlackCat/pull/2.diff","patch_url":"https://github.com/jayson/SlackCat/pull/2.patch","issue_url":"https://api.github.com/repos/jayson/SlackCat/issues/2","number":2,"state":"open","locked":false,"title":"updated with ++/-- functionality","user":{"login":"travisdesell","id":251158,"avatar_url":"https://avatars.githubusercontent.com/u/251158?v=3","gravatar_id":"","url":"https://api.github.com/users/travisdesell","html_url":"https://github.com/travisdesell","followers_url":"https://api.github.com/users/travisdesell/followers","following_url":"https://api.github.com/users/travisdesell/following{/other_user}","gists_url":"https://api.github.com/users/travisdesell/gists{/gist_id}","starred_url":"https://api.github.com/users/travisdesell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisdesell/subscriptions","organizations_url":"https://api.github.com/users/travisdesell/orgs","repos_url":"https://api.github.com/users/travisdesell/repos","events_url":"https://api.github.com/users/travisdesell/events{/privacy}","received_events_url":"https://api.github.com/users/travisdesell/received_events","type":"User","site_admin":false},"body":"Might not want to merge anything that's not leaderboard.rb","created_at":"2015-11-14T18:19:29Z","updated_at":"2015-11-15T15:48:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1f86eee63b40d11c8bbedf79289ae074d1394d38","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jayson/SlackCat/pulls/2/commits","review_comments_url":"https://api.github.com/repos/jayson/SlackCat/pulls/2/comments","review_comment_url":"https://api.github.com/repos/jayson/SlackCat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jayson/SlackCat/issues/2/comments","statuses_url":"https://api.github.com/repos/jayson/SlackCat/statuses/ed2111039722f40b057bc302bdc8a707ab64b135","head":{"label":"travisdesell:master","ref":"master","sha":"ed2111039722f40b057bc302bdc8a707ab64b135","user":{"login":"travisdesell","id":251158,"avatar_url":"https://avatars.githubusercontent.com/u/251158?v=3","gravatar_id":"","url":"https://api.github.com/users/travisdesell","html_url":"https://github.com/travisdesell","followers_url":"https://api.github.com/users/travisdesell/followers","following_url":"https://api.github.com/users/travisdesell/following{/other_user}","gists_url":"https://api.github.com/users/travisdesell/gists{/gist_id}","starred_url":"https://api.github.com/users/travisdesell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisdesell/subscriptions","organizations_url":"https://api.github.com/users/travisdesell/orgs","repos_url":"https://api.github.com/users/travisdesell/repos","events_url":"https://api.github.com/users/travisdesell/events{/privacy}","received_events_url":"https://api.github.com/users/travisdesell/received_events","type":"User","site_admin":false},"repo":{"id":46144267,"name":"SlackCat","full_name":"travisdesell/SlackCat","owner":{"login":"travisdesell","id":251158,"avatar_url":"https://avatars.githubusercontent.com/u/251158?v=3","gravatar_id":"","url":"https://api.github.com/users/travisdesell","html_url":"https://github.com/travisdesell","followers_url":"https://api.github.com/users/travisdesell/followers","following_url":"https://api.github.com/users/travisdesell/following{/other_user}","gists_url":"https://api.github.com/users/travisdesell/gists{/gist_id}","starred_url":"https://api.github.com/users/travisdesell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisdesell/subscriptions","organizations_url":"https://api.github.com/users/travisdesell/orgs","repos_url":"https://api.github.com/users/travisdesell/repos","events_url":"https://api.github.com/users/travisdesell/events{/privacy}","received_events_url":"https://api.github.com/users/travisdesell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/travisdesell/SlackCat","description":"A better SlackCat","fork":true,"url":"https://api.github.com/repos/travisdesell/SlackCat","forks_url":"https://api.github.com/repos/travisdesell/SlackCat/forks","keys_url":"https://api.github.com/repos/travisdesell/SlackCat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/travisdesell/SlackCat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/travisdesell/SlackCat/teams","hooks_url":"https://api.github.com/repos/travisdesell/SlackCat/hooks","issue_events_url":"https://api.github.com/repos/travisdesell/SlackCat/issues/events{/number}","events_url":"https://api.github.com/repos/travisdesell/SlackCat/events","assignees_url":"https://api.github.com/repos/travisdesell/SlackCat/assignees{/user}","branches_url":"https://api.github.com/repos/travisdesell/SlackCat/branches{/branch}","tags_url":"https://api.github.com/repos/travisdesell/SlackCat/tags","blobs_url":"https://api.github.com/repos/travisdesell/SlackCat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/travisdesell/SlackCat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/travisdesell/SlackCat/git/refs{/sha}","trees_url":"https://api.github.com/repos/travisdesell/SlackCat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/travisdesell/SlackCat/statuses/{sha}","languages_url":"https://api.github.com/repos/travisdesell/SlackCat/languages","stargazers_url":"https://api.github.com/repos/travisdesell/SlackCat/stargazers","contributors_url":"https://api.github.com/repos/travisdesell/SlackCat/contributors","subscribers_url":"https://api.github.com/repos/travisdesell/SlackCat/subscribers","subscription_url":"https://api.github.com/repos/travisdesell/SlackCat/subscription","commits_url":"https://api.github.com/repos/travisdesell/SlackCat/commits{/sha}","git_commits_url":"https://api.github.com/repos/travisdesell/SlackCat/git/commits{/sha}","comments_url":"https://api.github.com/repos/travisdesell/SlackCat/comments{/number}","issue_comment_url":"https://api.github.com/repos/travisdesell/SlackCat/issues/comments{/number}","contents_url":"https://api.github.com/repos/travisdesell/SlackCat/contents/{+path}","compare_url":"https://api.github.com/repos/travisdesell/SlackCat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/travisdesell/SlackCat/merges","archive_url":"https://api.github.com/repos/travisdesell/SlackCat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/travisdesell/SlackCat/downloads","issues_url":"https://api.github.com/repos/travisdesell/SlackCat/issues{/number}","pulls_url":"https://api.github.com/repos/travisdesell/SlackCat/pulls{/number}","milestones_url":"https://api.github.com/repos/travisdesell/SlackCat/milestones{/number}","notifications_url":"https://api.github.com/repos/travisdesell/SlackCat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/travisdesell/SlackCat/labels{/name}","releases_url":"https://api.github.com/repos/travisdesell/SlackCat/releases{/id}","created_at":"2015-11-13T20:01:36Z","updated_at":"2015-11-13T20:01:49Z","pushed_at":"2015-11-14T18:17:55Z","git_url":"git://github.com/travisdesell/SlackCat.git","ssh_url":"git@github.com:travisdesell/SlackCat.git","clone_url":"https://github.com/travisdesell/SlackCat.git","svn_url":"https://github.com/travisdesell/SlackCat","homepage":"","size":271,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jayson:master","ref":"master","sha":"63b9953bc0b641271e1602cffd2b7b4db723dc2c","user":{"login":"jayson","id":154509,"avatar_url":"https://avatars.githubusercontent.com/u/154509?v=3","gravatar_id":"","url":"https://api.github.com/users/jayson","html_url":"https://github.com/jayson","followers_url":"https://api.github.com/users/jayson/followers","following_url":"https://api.github.com/users/jayson/following{/other_user}","gists_url":"https://api.github.com/users/jayson/gists{/gist_id}","starred_url":"https://api.github.com/users/jayson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayson/subscriptions","organizations_url":"https://api.github.com/users/jayson/orgs","repos_url":"https://api.github.com/users/jayson/repos","events_url":"https://api.github.com/users/jayson/events{/privacy}","received_events_url":"https://api.github.com/users/jayson/received_events","type":"User","site_admin":false},"repo":{"id":25044609,"name":"SlackCat","full_name":"jayson/SlackCat","owner":{"login":"jayson","id":154509,"avatar_url":"https://avatars.githubusercontent.com/u/154509?v=3","gravatar_id":"","url":"https://api.github.com/users/jayson","html_url":"https://github.com/jayson","followers_url":"https://api.github.com/users/jayson/followers","following_url":"https://api.github.com/users/jayson/following{/other_user}","gists_url":"https://api.github.com/users/jayson/gists{/gist_id}","starred_url":"https://api.github.com/users/jayson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayson/subscriptions","organizations_url":"https://api.github.com/users/jayson/orgs","repos_url":"https://api.github.com/users/jayson/repos","events_url":"https://api.github.com/users/jayson/events{/privacy}","received_events_url":"https://api.github.com/users/jayson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jayson/SlackCat","description":"","fork":false,"url":"https://api.github.com/repos/jayson/SlackCat","forks_url":"https://api.github.com/repos/jayson/SlackCat/forks","keys_url":"https://api.github.com/repos/jayson/SlackCat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jayson/SlackCat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jayson/SlackCat/teams","hooks_url":"https://api.github.com/repos/jayson/SlackCat/hooks","issue_events_url":"https://api.github.com/repos/jayson/SlackCat/issues/events{/number}","events_url":"https://api.github.com/repos/jayson/SlackCat/events","assignees_url":"https://api.github.com/repos/jayson/SlackCat/assignees{/user}","branches_url":"https://api.github.com/repos/jayson/SlackCat/branches{/branch}","tags_url":"https://api.github.com/repos/jayson/SlackCat/tags","blobs_url":"https://api.github.com/repos/jayson/SlackCat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jayson/SlackCat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jayson/SlackCat/git/refs{/sha}","trees_url":"https://api.github.com/repos/jayson/SlackCat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jayson/SlackCat/statuses/{sha}","languages_url":"https://api.github.com/repos/jayson/SlackCat/languages","stargazers_url":"https://api.github.com/repos/jayson/SlackCat/stargazers","contributors_url":"https://api.github.com/repos/jayson/SlackCat/contributors","subscribers_url":"https://api.github.com/repos/jayson/SlackCat/subscribers","subscription_url":"https://api.github.com/repos/jayson/SlackCat/subscription","commits_url":"https://api.github.com/repos/jayson/SlackCat/commits{/sha}","git_commits_url":"https://api.github.com/repos/jayson/SlackCat/git/commits{/sha}","comments_url":"https://api.github.com/repos/jayson/SlackCat/comments{/number}","issue_comment_url":"https://api.github.com/repos/jayson/SlackCat/issues/comments{/number}","contents_url":"https://api.github.com/repos/jayson/SlackCat/contents/{+path}","compare_url":"https://api.github.com/repos/jayson/SlackCat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jayson/SlackCat/merges","archive_url":"https://api.github.com/repos/jayson/SlackCat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jayson/SlackCat/downloads","issues_url":"https://api.github.com/repos/jayson/SlackCat/issues{/number}","pulls_url":"https://api.github.com/repos/jayson/SlackCat/pulls{/number}","milestones_url":"https://api.github.com/repos/jayson/SlackCat/milestones{/number}","notifications_url":"https://api.github.com/repos/jayson/SlackCat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jayson/SlackCat/labels{/name}","releases_url":"https://api.github.com/repos/jayson/SlackCat/releases{/id}","created_at":"2014-10-10T16:54:10Z","updated_at":"2014-10-17T00:38:34Z","pushed_at":"2015-11-14T18:19:29Z","git_url":"git://github.com/jayson/SlackCat.git","ssh_url":"git@github.com:jayson/SlackCat.git","clone_url":"https://github.com/jayson/SlackCat.git","svn_url":"https://github.com/jayson/SlackCat","homepage":null,"size":271,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jayson/SlackCat/pulls/2"},"html":{"href":"https://github.com/jayson/SlackCat/pull/2"},"issue":{"href":"https://api.github.com/repos/jayson/SlackCat/issues/2"},"comments":{"href":"https://api.github.com/repos/jayson/SlackCat/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/jayson/SlackCat/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/jayson/SlackCat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jayson/SlackCat/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/jayson/SlackCat/statuses/ed2111039722f40b057bc302bdc8a707ab64b135"}}}}