Safe Haskell | None |
---|---|
Language | Haskell2010 |
Command handler utilities
Synopsis
- addCommands :: (BotC r, Member ParsePrefix r) => Sem (DSLState r) a -> Sem r (Sem r (), CommandHandler, a)
- buildCommands :: forall r a. Member (Final IO) r => Sem (DSLState r) a -> Sem r (CommandHandler, a)
- buildContext :: BotC r => Message -> Text -> Command -> Text -> Sem r (Maybe Context)
Documentation
addCommands :: (BotC r, Member ParsePrefix r) => Sem (DSLState r) a -> Sem r (Sem r (), CommandHandler, a) Source #
Construct commands and groups from a command DSL, then registers an event handler on the bot that manages running those commands.
Returns an action to remove the event handler, and the CommandHandler
that was constructed
buildCommands :: forall r a. Member (Final IO) r => Sem (DSLState r) a -> Sem r (CommandHandler, a) Source #
Run a command DSL, returning the constructed CommandHandler