summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornitros12 <>2021-04-08 02:50:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2021-04-08 02:50:00 (GMT)
commita37193f602de2cb96ea9aeb4379309e6c74b52f7 (patch)
tree955e45bd2de808e8aaf42435de4b8c3d2871406c
parent17a9f43bba3bf0e259ccab16216c08d8363c62b5 (diff)
version 0.1.26.10.1.26.1
-rw-r--r--Calamity/HTTP/Channel.hs55
-rw-r--r--ChangeLog.md4
-rw-r--r--calamity.cabal4
3 files changed, 34 insertions, 29 deletions
diff --git a/Calamity/HTTP/Channel.hs b/Calamity/HTTP/Channel.hs
index 6bcd184..f7b8823 100644
--- a/Calamity/HTTP/Channel.hs
+++ b/Calamity/HTTP/Channel.hs
@@ -1,20 +1,20 @@
-- | Channel endpoints
module Calamity.HTTP.Channel (
- ChannelRequest (..),
- CreateMessageOptions (..),
- EditMessageData (..),
- editMessageContent,
- editMessageEmbed,
- editMessageFlags,
- editMessageAllowedMentions,
- ChannelUpdate (..),
- AllowedMentionType (..),
- AllowedMentions (..),
- ChannelMessagesFilter (..),
- ChannelMessagesLimit (..),
- GetReactionsOptions (..),
- CreateChannelInviteOptions (..),
- GroupDMAddRecipientOptions (..),
+ ChannelRequest (..),
+ CreateMessageOptions (..),
+ EditMessageData (..),
+ editMessageContent,
+ editMessageEmbed,
+ editMessageFlags,
+ editMessageAllowedMentions,
+ ChannelUpdate (..),
+ AllowedMentionType (..),
+ AllowedMentions (..),
+ ChannelMessagesFilter (..),
+ ChannelMessagesLimit (..),
+ GetReactionsOptions (..),
+ CreateChannelInviteOptions (..),
+ GroupDMAddRecipientOptions (..),
) where
import Calamity.HTTP.Internal.Request
@@ -84,18 +84,19 @@ data CreateMessageJson = CreateMessageJson
deriving (Show, Generic)
deriving (ToJSON) via CalamityJSON CreateMessageJson
--- | Parameters to the Edit Message endpoint.
---
--- Use the provided methods (@editMessageX@) to create a value with the
--- field set, use the Semigroup instance to union the values.
---
--- ==== Examples
---
--- >>> encode $ editMessageContent (Just "test") <> editMessageFlags Nothing
--- "{\"nick\":\"test\",\"deaf\":null}"
+{- | Parameters to the Edit Message endpoint.
+
+ Use the provided methods (@editMessageX@) to create a value with the
+ field set, use the Semigroup instance to union the values.
+
+ ==== Examples
+
+ >>> encode $ editMessageContent (Just "test") <> editMessageFlags Nothing
+ "{\"nick\":\"test\",\"deaf\":null}"
+-}
newtype EditMessageData = EditMessageData Object
- deriving (Show, Generic)
- deriving newtype (ToJSON, Semigroup, Monoid)
+ deriving (Show, Generic)
+ deriving newtype (ToJSON, Semigroup, Monoid)
editMessageContent :: Maybe Text -> EditMessageData
editMessageContent v = EditMessageData $ H.fromList [("content", toJSON v)]
@@ -306,7 +307,7 @@ instance Request (ChannelRequest a) where
getWithP ("before" =: a <> "limit" =:? (showt . (^. #limit) <$> l))
action (GetChannelMessages _ (Just (ChannelMessagesAfter (showt . fromSnowflake -> a))) l) =
getWithP ("after" =: a <> "limit" =:? (showt . (^. #limit) <$> l))
- action (GetChannelMessages _ Nothing _) = getWith
+ action (GetChannelMessages _ Nothing l) = getWithP ("limit" =:? (showt . (^. #limit) <$> l))
action (GetMessage _ _) = getWith
action CreateReaction{} = putEmpty
action DeleteOwnReaction{} = deleteWith
diff --git a/ChangeLog.md b/ChangeLog.md
index 77b2378..f5cda2f 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,9 @@
# Changelog for Calamity
+## 0.1.26.1
+
++ Quick fix of GetChannelMessages
+
## 0.1.26.0
+ `GetChannelMessages` now has an extra parameter to allow the `limit` option to
diff --git a/calamity.cabal b/calamity.cabal
index cf9f4f8..506f630 100644
--- a/calamity.cabal
+++ b/calamity.cabal
@@ -4,10 +4,10 @@ cabal-version: 1.18
--
-- see: https://github.com/sol/hpack
--
--- hash: a1e915ba8a1a42f16586860ef601fb5dd7545de1073ccc98e940cf37539c35fe
+-- hash: fd4324b88c3e1af82980462b807e21231e704910a8187311dbb902ed02735a29
name: calamity
-version: 0.1.26.0
+version: 0.1.26.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