Skip to content

Instantly share code, notes, and snippets.

@joekarma
Created November 6, 2012 09:59
Show Gist options
  • Save joekarma/4023804 to your computer and use it in GitHub Desktop.
Save joekarma/4023804 to your computer and use it in GitHub Desktop.
Get list (actually, hash table) of IRC channel participants using the cl-irc library. :depends-on (:cl-irc :trivial-timeout)
(defun get-channel-users (nickname channel &key username password)
(let ((connection (irc:connect :nickname nickname
:username username
:password password)))
(unwind-protect
(with-timeout (60)
(irc:join connection channel)
(irc:add-hook connection 'irc:irc-rpl_endofnames-message
(lambda (msg)
(declare (ignore msg))
(return-from get-channel-users (irc:users (irc:find-channel connection channel)))))
(irc:read-message-loop connection))
(irc:part connection channel)
(irc:die connection))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment