implement
This commit is contained in:
parent
31013f8ea7
commit
0e8eae2a40
1 changed files with 11 additions and 0 deletions
11
irc.lamb
11
irc.lamb
|
@ -10,6 +10,11 @@ ADMINS = ["darkf"].
|
||||||
-- channels to join
|
-- channels to join
|
||||||
CHANS = ["#lobby"].
|
CHANS = ["#lobby"].
|
||||||
|
|
||||||
|
-- the lexical environment that $eval uses
|
||||||
|
EVAL_ENV = [("loop", loop),
|
||||||
|
("repr", repr),
|
||||||
|
("itos", itos)].
|
||||||
|
|
||||||
-- First we'll define some helper functions
|
-- First we'll define some helper functions
|
||||||
|
|
||||||
map(f, []) -> [].
|
map(f, []) -> [].
|
||||||
|
@ -137,6 +142,12 @@ handleMessage(s, nick, chan, "$savefacts") -> do
|
||||||
s
|
s
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
handleMessage(s, nick, chan, "$eval "::line) -> do
|
||||||
|
ret = eval(line, EVAL_ENV);
|
||||||
|
say(chan, nick + ": " + repr(ret));
|
||||||
|
s
|
||||||
|
end.
|
||||||
|
|
||||||
handleMessage(s, nick, chan, "$join "::j) -> do
|
handleMessage(s, nick, chan, "$join "::j) -> do
|
||||||
if isAdmin(nick) then do
|
if isAdmin(nick) then do
|
||||||
fputstr(sock, "JOIN " + j + "\r\n");
|
fputstr(sock, "JOIN " + j + "\r\n");
|
||||||
|
|
Loading…
Reference in a new issue