implement
This commit is contained in:
parent
0e8eae2a40
commit
49cdd857ee
1 changed files with 14 additions and 0 deletions
14
irc.lamb
14
irc.lamb
|
@ -167,6 +167,20 @@ handleMessage(s, nick, chan, "$quit") -> do
|
||||||
s
|
s
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
handleMessage(s, nick, chan, "$at "::line) -> do
|
||||||
|
(toNick, fact) = takeUntilSpace(line);
|
||||||
|
factoids = getFactoids(s);
|
||||||
|
factoid = map_lookup(factoids, fact);
|
||||||
|
if is_just(factoid) then do
|
||||||
|
say(chan, toNick + ": " + unwrap_maybe(factoid));
|
||||||
|
s
|
||||||
|
end
|
||||||
|
else do
|
||||||
|
say(chan, nick + ": No such factoid: " + fact);
|
||||||
|
s
|
||||||
|
end
|
||||||
|
end.
|
||||||
|
|
||||||
-- unknown command, search factoids
|
-- unknown command, search factoids
|
||||||
handleMessage(s, nick, chan, "$"::line) -> do
|
handleMessage(s, nick, chan, "$"::line) -> do
|
||||||
(fact, rest) = takeUntilSpace(line);
|
(fact, rest) = takeUntilSpace(line);
|
||||||
|
|
Loading…
Reference in a new issue