Skip to content

Instantly share code, notes, and snippets.

@eschulte
Created July 11, 2011 21:10
Show Gist options
  • Save eschulte/1076803 to your computer and use it in GitHub Desktop.
Save eschulte/1076803 to your computer and use it in GitHub Desktop.
(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