forked from rknLA/irc-slack-echo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Default bind interface is now 0.0.0.0 (was localhost), and default po…
- Loading branch information
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
77a800c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops.