Safe Haskell | None |
---|---|
Language | Haskell2010 |
Calamity commands This module only exports the DSL and core types for using commands
Synopsis
- module Calamity.Commands.Dsl
- module Calamity.Commands.Error
- module Calamity.Commands.Handler
- module Calamity.Commands.Utils
- module Calamity.Commands.ParsePrefix
- module Calamity.Commands.Parser
- module Calamity.Commands.Help
Documentation
module Calamity.Commands.Dsl
module Calamity.Commands.Error
module Calamity.Commands.Handler
module Calamity.Commands.Utils
module Calamity.Commands.Parser
module Calamity.Commands.Help
Commands
This module provides abstractions for writing declarative commands, that support grouping, pre-invokation checks, and automatic argument parsing by using a type level list of parameter types.
A DSL is provided in Dsl
for constructing commands
declaratively.
You can implement Parser
for your own types to allow them to be used in the
parameter list of commands.
A default help command is provided in Help
which can be
added just by using helpCommand
inside the command declaration DSL.
Examples
An example of using commands:
addCommands
$ dohelpCommand
command
@'[User
] "utest" $ ctx u -> dovoid
$tell
ctx $ "got user: "<>
showtl
ugroup
"admin" $ docommand
@'[] "bye" $ ctx -> dovoid
$tell
ctx "bye!"stopBot