add rollcall support
parent
b27ba949e7
commit
728c255e9b
9
Anna.hs
9
Anna.hs
|
@ -67,7 +67,10 @@ tokenDispatch (Just userName) (Just chn) ts = if elem "PRIVMSG" ts
|
||||||
| elem "o/" tokens = updateRightGreets
|
| elem "o/" tokens = updateRightGreets
|
||||||
| elem "\\o" tokens = updateLeftGreets
|
| elem "\\o" tokens = updateLeftGreets
|
||||||
| otherwise = case head tokens of
|
| otherwise = case head tokens of
|
||||||
|
-- TODO: make reader monad for this? passing chn is a little tedious
|
||||||
"!greets" -> greets chn
|
"!greets" -> greets chn
|
||||||
|
"!rollcall" -> rollcall chn
|
||||||
|
"!anna" -> anna chn
|
||||||
_ -> return ()
|
_ -> return ()
|
||||||
tokens = case length msgTokens of
|
tokens = case length msgTokens of
|
||||||
1 -> [rstrip $ tail $ head msgTokens]
|
1 -> [rstrip $ tail $ head msgTokens]
|
||||||
|
@ -103,9 +106,15 @@ greets chn = do
|
||||||
displayLine = "o/ - " ++ (head contentLines) ++ " vs \\o - " ++ (head $ tail contentLines)
|
displayLine = "o/ - " ++ (head contentLines) ++ " vs \\o - " ++ (head $ tail contentLines)
|
||||||
sendMessage chn displayLine
|
sendMessage chn displayLine
|
||||||
|
|
||||||
|
rollcall :: String -> Net ()
|
||||||
|
rollcall chn = sendMessage chn "Hello! I respond to !anna and !greets. My source code is available at https://git.tilde.town/opfez/anna"
|
||||||
|
anna = rollcall
|
||||||
|
|
||||||
timezone :: String -> String -> Net ()
|
timezone :: String -> String -> Net ()
|
||||||
timezone chn username = undefined
|
timezone chn username = undefined
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Basic commands
|
-- Basic commands
|
||||||
write :: String -> String -> Net ()
|
write :: String -> String -> Net ()
|
||||||
write cmd args = do
|
write cmd args = do
|
||||||
|
|
Loading…
Reference in New Issue