aeirola / slack-irc-client

Use Slack as your IRC client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

warn: Failed to parse channel config SyntaxError

Arthaey opened this issue · comments

I'm testing out using this to participated in an IRC channel via the Slack web client. I'm seeing this warning in the terminal:

warn: Failed to parse channel config SyntaxError: Unexpected token T
    at Object.parse (native)
    at Object.parseConfig (/usr/local/lib/node_modules/slack-irc-client/lib/slack-handler.js:18:17)
    at Object.getIrcChannelName (/usr/local/lib/node_modules/slack-irc-client/lib/slack-handler.js:10:33)
    at message (/usr/local/lib/node_modules/slack-irc-client/lib/slack-handler.js:60:24)
    at RTMClient.handler._boundListener (/usr/local/lib/node_modules/slack-irc-client/lib/slack-handler.js:137:24)
    at RTMClient.emit (/usr/local/lib/node_modules/slack-irc-client/node_modules/eventemitter3/index.js:116:35)
    at RTMClient.emit (/usr/local/lib/node_modules/slack-irc-client/node_modules/@slack/client/lib/clients/client.js:86:39)
    at RTMClient._handleWsMessageViaEventHandler (/usr/local/lib/node_modules/slack-irc-client/node_modules/@slack/client/lib/clients/rtm/client.js:447:10)
    at RTMClient.handleWsMessage (/usr/local/lib/node_modules/slack-irc-client/node_modules/@slack/client/lib/clients/rtm/client.js:401:10)
    at WebSocket.wrapper (/usr/local/lib/node_modules/slack-irc-client/node_modules/@slack/client/node_modules/lodash/index.js:3095:19)
    at emitTwo (events.js:100:13)
    at WebSocket.emit (events.js:185:7)
    at Receiver.ontext (/usr/local/lib/node_modules/slack-irc-client/node_modules/ws/lib/WebSocket.js:841:10)
    at /usr/local/lib/node_modules/slack-irc-client/node_modules/ws/lib/Receiver.js:536:18
    at Receiver.applyExtensions (/usr/local/lib/node_modules/slack-irc-client/node_modules/ws/lib/Receiver.js:371:5)
    at /usr/local/lib/node_modules/slack-irc-client/node_modules/ws/lib/Receiver.js:508:14

Yet I do seem to be logged in to my channel, so perhaps it's a spurious or unimportant error?

Yeah, that is due to the channel purpose field being used for channel specific configurations. Channel specific configurations aren't needed for normal channels, but are there so that one can input, and join, channel names that are not allowed in Slack.

The warning message should probably be more informative about this, and could actually check for the default purpose strings set by Slack on team creation.

Thanks for bringing this up!

Released version 0.1.6 which is a bit smarter about which channels seem to have JSON configurations in the purpose field, and not log errors for the ones that don't.