Created
July 11, 2011 21:10
-
-
Save eschulte/1076803 to your computer and use it in GitHub Desktop.
This file contains 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) (require :cl-ppcre) | |
(defpackage :adapt-bot (:use :cl :cl-irc :cl-ppcre)) | |
(in-package :adapt-bot) | |
(defvar *connection* | |
(connect :nickname "adaptive-lab-bot" :server "irc.freenode.net")) | |
(defvar *group* "#adaptiveunm") | |
(defun say (fmt &rest args) | |
(privmsg *connection* *group* (apply #'format (append (list nil fmt) args)))) | |
(defun msg-hook (msg) | |
(let ((who (source msg)) | |
(what (second (arguments msg)))) | |
(when (scan "python" what) | |
(say "~a: nobody cares about that language" who)))) | |
(defun run-bot () | |
(join *connection* "#adaptiveunm") | |
(add-hook *connection* 'irc::irc-privmsg-message 'msg-hook) | |
(start-background-message-handler *connection*)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment