-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathirc.lisp
53 lines (38 loc) · 1.51 KB
/
irc.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
;; Defines some irc commands
(in-package :lotzo)
(defun quit-irc ()
(send "QUIT" *irc-socket*))
(defun say (to msg)
(send (concatenate 'string "PRIVMSG " to " :" msg) *irc-socket*))
(defun action (to msg)
(send (concatenate 'string "PRIVMSG " to " :*" msg "*") *irc-socket*))
(defun kick (who channel)
(when *operator*
(send (concatenate 'string "KICK " channel " " who) *irc-socket*)))
(defun ban (who channel)
(when *operator*
(send (concatenate 'string "MODE " channel " +b " who) *irc-socket*)))
(defun deban (who channel)
(when *operator*
(send (concatenate 'string "MODE " channel " -b " who) *irc-socket*)))
(defun op (who channel)
(when *operator*
(send (concatenate 'string "MODE " channel " +o " who) *irc-socket*)))
(defun deop (who channel)
(when *operator*
(send (concatenate 'string "MODE " channel " -o " who) *irc-socket*)))
(defun voice (who channel)
(when *operator*
(send (concatenate 'string "MODE " channel " +v " who) *irc-socket*)))
(defun devoice (who channel)
(when *operator*
(send (concatenate 'string "MODE " channel " -v " who) *irc-socket*)))
(defun whois (who channel)
(send (concatenate 'string "WHOIS " channel " " who) *irc-socket*))
(defun users (channel)
(send (concatenate 'string "NAMES " channel) *irc-socket*))
(defun join (channel)
(pushnew channel *channels*)
(send (concatenate 'string "JOIN " channel) *irc-socket*))
(defun topic (channel text)
(send (concatenate 'string "TOPIC " channel " :" text) *irc-socket*))