equal
deleted
inserted
replaced
63 else |
63 else |
64 handleCmd_loggedin cmd |
64 handleCmd_loggedin cmd |
65 else |
65 else |
66 handleCmd_NotEntered cmd |
66 handleCmd_NotEntered cmd |
67 |
67 |
|
68 unknownCmdWarningText :: B.ByteString |
|
69 unknownCmdWarningText = loc "Unknown command or invalid parameters. Say '/help' in chat for a list of commands." |
|
70 |
|
71 handleCmd_loggedin ["CMD"] = return [Warning unknownCmdWarningText] |
68 |
72 |
69 handleCmd_loggedin ["CMD", parameters] = uncurry h $ extractParameters parameters |
73 handleCmd_loggedin ["CMD", parameters] = uncurry h $ extractParameters parameters |
70 where |
74 where |
71 h "DELEGATE" n | not $ B.null n = handleCmd ["DELEGATE", n] |
75 h "DELEGATE" n | not $ B.null n = handleCmd ["DELEGATE", n] |
72 h "SAVEROOM" n | not $ B.null n = handleCmd ["SAVEROOM", n] |
76 h "SAVEROOM" n | not $ B.null n = handleCmd ["SAVEROOM", n] |
109 cl <- thisClient |
113 cl <- thisClient |
110 return |
114 return |
111 [ModifyClient (\c -> c{hasSuperPower = True}) |
115 [ModifyClient (\c -> c{hasSuperPower = True}) |
112 , AnswerClients [sendChan cl] ["CHAT", nickServer, loc "Super power activated."] |
116 , AnswerClients [sendChan cl] ["CHAT", nickServer, loc "Super power activated."] |
113 ] |
117 ] |
114 h _ _ = return [Warning $ loc "Unknown command or invalid parameters. Say '/help' in chat for a list of commands." ] |
118 h _ _ = return [Warning unknownCmdWarningText] |
115 |
119 |
116 |
120 |
117 extractParameters p = let (a, b) = B.break (== ' ') p in (upperCase a, B.dropWhile (== ' ') b) |
121 extractParameters p = let (a, b) = B.break (== ' ') p in (upperCase a, B.dropWhile (== ' ') b) |
118 |
122 |
119 handleCmd_loggedin ["INFO", asknick] = do |
123 handleCmd_loggedin ["INFO", asknick] = do |