Add command submodules
This commit is contained in:
parent
3e2120f970
commit
c485404528
5 changed files with 65 additions and 2 deletions
15
src/Haboli/Euphoria/Command/Megaparsec.hs
Normal file
15
src/Haboli/Euphoria/Command/Megaparsec.hs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
module Haboli.Euphoria.Command.Megaparsec
|
||||
( cmdMega
|
||||
) where
|
||||
|
||||
import qualified Data.Text as T
|
||||
import Text.Megaparsec
|
||||
|
||||
import Haboli.Euphoria.Api
|
||||
import Haboli.Euphoria.Client
|
||||
import Haboli.Euphoria.Command
|
||||
|
||||
cmdMega :: Parsec e' T.Text a -> (Message -> a -> Client e ()) -> Command e
|
||||
cmdMega parser f msg = case parse parser "" $ msgContent msg of
|
||||
Left _ -> pure False
|
||||
Right a -> True <$ f msg a
|
||||
Loading…
Add table
Add a link
Reference in a new issue