Skip to content

Commit

Permalink
Default bind interface is now 0.0.0.0 (was localhost), and default po…
Browse files Browse the repository at this point in the history
…rt is 2666 (was 666).

Fixes rknLA#4, rknLA#5 and rknLA#10
  • Loading branch information
Guillaume Boudreau authored and dannon committed Aug 31, 2014
1 parent 82e5833 commit 77a800c
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions slack.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
diff --git config.js config.js
index eb36c35..b28bfd9 100644
--- config.js
+++ config.js
@@ -1,19 +1,19 @@
module.exports = {
slack: {
- host: 'my.slack.com',
- incomingWebhookToken: 'your incoming webhook token',
- outgoingWebhookToken: 'your outgoing webhook token',
+ host: 'galaxy.slack.com',
+ incomingWebhookToken: 'asiefBea1QKebUmyDdfIw2uf',
+ outgoingWebhookToken: 'KkHkBgv8rSCrumt87yXlorC3',
outgoingWebhookServer: {
- port: 666,
- domain: 'your.webhook.server.com',
+ port: 8999,
+ domain: 'orangehack.com',
hookPath: '/irc-echo'
},
- echoChannel: '#irc-echo',
- botName: 'IRCBot',
+ echoChannel: '#dbtst',
+ botName: 'slackbot',
},
irc: {
- server: 'your.irc.net',
- nick: 'slackbot',
- channel: '#mychan'
+ server: 'chat.freenode.net',
+ nick: 'gxyslackbot',
+ channel: '#dannon_test'
},
};
diff --git lib/slack.js lib/slack.js
index 22758e5..1b0a9ce 100644
--- lib/slack.js
+++ lib/slack.js
@@ -156,12 +156,16 @@ var slackBotMethods = {
var handleSlackInput = function(payload) {
if (ircClient) {
// remove trigger word
- var deTriggered = payload.text.slice(payload.trigger_word.length);
+ //var deTriggered = payload.text.slice(payload.trigger_word.length);
+ var deTriggered = payload.text
var words = deTriggered.split(' ');
+ if (payload.user_name === config.slack.botName){
+ // Discard the slack-side bot's (usually slackbot) chatter.
+ return;
+ }
if (words[0] == ':') {
words = words.slice(1);
}
-
var command = words[0];
payload.commandless_words = words.slice(1);
if (_.has(slackBotMethods, command)) {
diff --git userMap.json userMap.json
index 9e90b28..5559013 100644
--- userMap.json
+++ userMap.json
@@ -1,8 +1 @@
-{
- // you'll get a parse error unless you remove these comments
- // i've kept the comments in so this deliberately breaks.
- // this file will eventually be dynamically written to, but
- // in the meantime, bootstrap it with one or two irc/slack pairs.
-
- /* "irc_username": "slack_username", */
-}
+{"dannon":"dannon"}
\ No newline at end of file

1 comment on commit 77a800c

@dannon
Copy link
Owner

@dannon dannon commented on 77a800c Aug 31, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops.

Please sign in to comment.