Created
June 25, 2010 04:32
-
-
Save ldunn/452407 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| (require :cl-irc) | |
| (defpackage #:litht | |
| (:use #:common-lisp #:cl-irc)) | |
| (in-package :litht) | |
| (defvar *connection* nil) | |
| ;(defun msg-hook (message) | |
| ; (describe message) | |
| ; (handler-case | |
| ; (let ((connection (connection message))) | |
| ; (privmsg *connection* "#bots" "hi!") | |
| ; ;(privmsg connection "#bots" (last (ARGUMENTS message)))) | |
| ; (error (condition) (describe condition))))) | |
| (defun msg-hook (message) | |
| (handler-case | |
| (let ((connection (connection message))) | |
| (describe message) | |
| (privmsg connection "#bots" "hi"))) | |
| (privmsg | |
| (and (eq *connection* (connection message)) (connection message)) | |
| "#bots" (received-time message))) | |
| (defun connect-bot (hostname nickname channel) | |
| (setf *connection* (irc:connect :nickname nickname | |
| :server hostname)) | |
| (sleep 3) | |
| (irc:join *connection* channel) | |
| (irc:add-hook *connection* 'irc-privmsg-message #'msg-hook) | |
| (irc:start-background-message-handler *connection*)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment