calamity 0.1.30.0 → 0.1.30.1
raw patch · 5 files changed
+16/−7 lines, 5 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Calamity.Commands.Utils: useConstantPrefix :: Text -> Sem (ParsePrefix Message : r) a -> Sem r a
Files
- Calamity/Commands.hs +2/−4
- Calamity/Commands/Utils.hs +6/−0
- ChangeLog.md +5/−0
- README.md +1/−1
- calamity.cabal +2/−2
Calamity/Commands.hs view
@@ -6,7 +6,6 @@ module CalamityCommands.Error, module CalamityCommands.Handler, module Calamity.Commands.Help,- module CalamityCommands.ParsePrefix, module CalamityCommands.Parser, module Calamity.Commands.Utils, @@ -20,7 +19,6 @@ import Calamity.Commands.Utils import CalamityCommands.Error import CalamityCommands.Handler-import CalamityCommands.ParsePrefix import CalamityCommands.Parser {- $commandDocs@@ -46,8 +44,8 @@ 1. 'CalamityCommands.ParsePrefix.ParsePrefix' - Handles parsing prefixes, "CalamityCommands" provides the- 'CalamityCommands.ParsePrefix.useConstantPrefix' function for constant+ Handles parsing prefixes, the+ 'Calamity.Commands.Utils.useConstantPrefix' function handles constant prefixes. 2. 'CalamityCommands.Context.ConstructContext'
Calamity/Commands/Utils.hs view
@@ -4,6 +4,7 @@ -- | Command handler utilities module Calamity.Commands.Utils ( addCommands,+ useConstantPrefix, CmdInvokeFailReason (..), CtxCommandError (..), CommandNotFound (..),@@ -50,6 +51,11 @@ { ctx :: c } deriving stock (Show, Generic)++-- | A default interpretation for 'CC.ParsePrefix' that uses a single constant prefix.+useConstantPrefix :: L.Text -> P.Sem (CC.ParsePrefix Message ': r) a -> P.Sem r a+useConstantPrefix pre = P.interpret (\case+ CC.ParsePrefix Message { content } -> pure ((pre, ) <$> L.stripPrefix pre content)) -- | Construct commands and groups from a command DSL, then registers an event -- handler on the bot that manages running those commands.
ChangeLog.md view
@@ -1,5 +1,10 @@ # Changelog for Calamity +## 0.1.30.1+++ Removed the re-export of `CalamityCommands.ParsePrefix` from Calamity.Commands.++ Added the `Calamity.Commands.Utils.useConstantPrefix` method+ ## 0.1.30.0 + Removed the `Symbol` parameter of custom events, instead of `'CustomEvt
README.md view
@@ -56,7 +56,7 @@ {- cabal: build-depends: base >= 4.13 && < 5- , calamity >= 0.1.28+ , calamity >= 0.1.30 , text >= 1.2 && < 2 , lens >= 4.18 && < 5 , di-polysemy ^>= 0.2
calamity.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 154662ee222dbfe7a26afc26afaa4243ceb89b1cccf3a71624f5b4c865436e46+-- hash: 5d6785177c7a779a3dd4d3fe63a45997bd3697961f2756675e389b2da37cb817 name: calamity-version: 0.1.30.0+version: 0.1.30.1 synopsis: A library for writing discord bots in haskell description: Please see the README on GitHub at <https://github.com/simmsb/calamity#readme> category: Network, Web