I'm using the cl-irc library to connect to Slack, via the IRC gateway Slack provides.
However I'm getting the following error when I try to start the message loop with read-message-loop
:
error while parsing arguments to DESTRUCTURING-BIND:
invalid number of elements in
("duncan_bayne" "Welcome" "to" "Slack" "IRC" "Gateway"
"server" "duncan_bayne!~duncan_bayne@1.2.3.4")
to satisfy lambda list
(CL-IRC:NICKNAME CL-IRC::WELCOME-MESSAGE):
exactly 2 expected, but 8 found
[Condition of type SB-KERNEL::ARG-COUNT-ERROR]
...
Backtrace:
0: ((:METHOD CL-IRC::DEFAULT-HOOK (CL-IRC:IRC-RPL_WELCOME-MESSAGE)) #<CL-IRC:IRC-RPL_WELCOME-MESSAGE irc.tinyspeck.com RPL_WELCOME {1007FC6293}>) [fast-method]
1: ((:METHOD CL-IRC::APPLY-TO-HOOKS (T)) #<CL-IRC:IRC-RPL_WELCOME-MESSAGE irc.tinyspeck.com RPL_WELCOME {1007FC6293}>) [fast-method]
2: ((:METHOD CL-IRC:IRC-MESSAGE-EVENT (T CL-IRC:IRC-MESSAGE)) #<unavailable argument> #<CL-IRC:IRC-RPL_WELCOME-MESSAGE irc.tinyspeck.com RPL_WELCOME {1007FC6293}>) [fast-method]
3: ((:METHOD CL-IRC:READ-MESSAGE (CL-IRC:CONNECTION)) #<CL-IRC:CONNECTION myob.irc.slack.com {10068E8ED3}>) [fast-method]
4: ((:METHOD CL-IRC:READ-MESSAGE-LOOP (T)) #<CL-IRC:CONNECTION myob.irc.slack.com {10068E8ED3}>) [fast-method]
5: (SB-INT:SIMPLE-EVAL-IN-LEXENV (CL-IRC:READ-MESSAGE-LOOP *CONN*) #<NULL-LEXENV>)
6: (EVAL (CL-IRC:READ-MESSAGE-LOOP *CONN*))
While in the REPL I see:
UNHANDLED-EVENT:3672562852: RPL_MYINFO: irc.tinyspeck.com duncan_bayne "IRC-SLACK gateway"
I'm not sure what I'm doing wrong here; I'm fairly sure it's not my hooks, because the problem persists even if I disable them all.
Also, I can use the connection as expected - say, joining a channel and sending messages - provided I don't try to start the message loop.
At a guess, I'd say Slack is responding to connection with an unexpected message?