Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slack Incoming Webhooks instructions / interface has changed #13

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

liyang
Copy link

@liyang liyang commented Jan 19, 2015

Now all incoming requests go to hooks.slack.com, and the hook setup instructions doesn't refer to a ‘token’ any more.

I removed the 'channel' and 'username' options because this script cannot mirror to than one Slack channel at a time—nor does the channel / bot username ever change—and in any case can be configured via the defaults on the Slack hook configuration interface when setting one up.

Also, if a mapped nick speaks on IRC, the 'from' variable wasn't being mapped to the corresponding Slack nick.

Also, I improved the nick mapping by only matching on word boundaries.

Also, I took the liberty of adding support for '/me derps.'

Also, I decided to replace the [#irc-channel] tag from the text sent to Slack, since we do not monitor more than one channel per instance. Instead, we tags private messages to the bot as such.

Feel free to take any or all of the above. Or let me know which changes you're not sure about and I'll remove them from this PR.

∙ Defaults can be configured per incoming-webhook via Slack;
  these options only add confusion, since neither echoChannel
  nor botName can change dynamically.
@liyang liyang force-pushed the master branch 4 times, most recently from f12e790 to 6ace2ce Compare January 20, 2015 03:47
∙ Also console.log() the exact message sent to Slack, rather than
  a completely different format: this is more useful.
  ∘ Was this copypasta from the "bot.js" example from the "irc" package?

∙ Pass the unadulterated message to handCommand(): for the mapped nicks, it
  can always perform the mapping again; the reverse is much more awkward.

∙ config.irc.nick isn't necessarily our assigned nick; client.nick instead.

∙ I don't understand why there was an unnecessary "var room = to;"
∙ Prevents e.g. ‘foobar’↦‘soapbar’ when there's an entry of ‘foo’↦‘soap’.
  ∘ Schoolboy regex oversight.
∙ There can be only one channel. So why bother?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant