calamity-0.1.11.0: A library for writing discord bots
Safe HaskellNone
LanguageHaskell2010

Calamity.Commands.Utils

Description

Command handler utilities

Synopsis

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

buildContext :: BotC r => Message -> Text -> Command -> Text -> Sem r (Maybe Context) Source #

Attempt to build the context for a command