summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornitros12 <>2021-04-07 17:51:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2021-04-07 17:51:00 (GMT)
commit17a9f43bba3bf0e259ccab16216c08d8363c62b5 (patch)
tree624d1de6af2720c7bf65d619fd69bd89e00a882b
parente061856973b998f8499636e8b102472d109a4b5a (diff)
version 0.1.26.00.1.26.0
-rw-r--r--Calamity.hs (renamed from src/Calamity.hs)0
-rw-r--r--Calamity/Cache/Eff.hs (renamed from src/Calamity/Cache/Eff.hs)0
-rw-r--r--Calamity/Cache/InMemory.hs (renamed from src/Calamity/Cache/InMemory.hs)0
-rw-r--r--Calamity/Client.hs (renamed from src/Calamity/Client.hs)0
-rw-r--r--Calamity/Client/Client.hs (renamed from src/Calamity/Client/Client.hs)1
-rw-r--r--Calamity/Client/ShardManager.hs (renamed from src/Calamity/Client/ShardManager.hs)0
-rw-r--r--Calamity/Client/Types.hs (renamed from src/Calamity/Client/Types.hs)0
-rw-r--r--Calamity/Commands.hs (renamed from src/Calamity/Commands.hs)0
-rw-r--r--Calamity/Commands/AliasType.hs (renamed from src/Calamity/Commands/AliasType.hs)0
-rw-r--r--Calamity/Commands/Check.hs (renamed from src/Calamity/Commands/Check.hs)0
-rw-r--r--Calamity/Commands/Command.hs (renamed from src/Calamity/Commands/Command.hs)0
-rw-r--r--Calamity/Commands/Command.hs-boot (renamed from src/Calamity/Commands/Command.hs-boot)0
-rw-r--r--Calamity/Commands/CommandUtils.hs (renamed from src/Calamity/Commands/CommandUtils.hs)0
-rw-r--r--Calamity/Commands/Context.hs (renamed from src/Calamity/Commands/Context.hs)0
-rw-r--r--Calamity/Commands/Context.hs-boot (renamed from src/Calamity/Commands/Context.hs-boot)0
-rw-r--r--Calamity/Commands/Dsl.hs (renamed from src/Calamity/Commands/Dsl.hs)0
-rw-r--r--Calamity/Commands/Error.hs (renamed from src/Calamity/Commands/Error.hs)0
-rw-r--r--Calamity/Commands/Group.hs (renamed from src/Calamity/Commands/Group.hs)0
-rw-r--r--Calamity/Commands/Handler.hs (renamed from src/Calamity/Commands/Handler.hs)0
-rw-r--r--Calamity/Commands/Help.hs (renamed from src/Calamity/Commands/Help.hs)0
-rw-r--r--Calamity/Commands/ParsePrefix.hs (renamed from src/Calamity/Commands/ParsePrefix.hs)0
-rw-r--r--Calamity/Commands/Parser.hs (renamed from src/Calamity/Commands/Parser.hs)0
-rw-r--r--Calamity/Commands/Utils.hs (renamed from src/Calamity/Commands/Utils.hs)0
-rw-r--r--Calamity/Gateway.hs (renamed from src/Calamity/Gateway.hs)0
-rw-r--r--Calamity/Gateway/DispatchEvents.hs (renamed from src/Calamity/Gateway/DispatchEvents.hs)0
-rw-r--r--Calamity/Gateway/Intents.hs (renamed from src/Calamity/Gateway/Intents.hs)0
-rw-r--r--Calamity/Gateway/Shard.hs (renamed from src/Calamity/Gateway/Shard.hs)41
-rw-r--r--Calamity/Gateway/Types.hs (renamed from src/Calamity/Gateway/Types.hs)0
-rw-r--r--Calamity/HTTP.hs (renamed from src/Calamity/HTTP.hs)0
-rw-r--r--Calamity/HTTP/AuditLog.hs (renamed from src/Calamity/HTTP/AuditLog.hs)0
-rw-r--r--Calamity/HTTP/Channel.hs (renamed from src/Calamity/HTTP/Channel.hs)34
-rw-r--r--Calamity/HTTP/Emoji.hs (renamed from src/Calamity/HTTP/Emoji.hs)0
-rw-r--r--Calamity/HTTP/Guild.hs (renamed from src/Calamity/HTTP/Guild.hs)0
-rw-r--r--Calamity/HTTP/Internal/Ratelimit.hs (renamed from src/Calamity/HTTP/Internal/Ratelimit.hs)0
-rw-r--r--Calamity/HTTP/Internal/Request.hs (renamed from src/Calamity/HTTP/Internal/Request.hs)2
-rw-r--r--Calamity/HTTP/Internal/Route.hs (renamed from src/Calamity/HTTP/Internal/Route.hs)0
-rw-r--r--Calamity/HTTP/Internal/Types.hs (renamed from src/Calamity/HTTP/Internal/Types.hs)0
-rw-r--r--Calamity/HTTP/Invite.hs (renamed from src/Calamity/HTTP/Invite.hs)0
-rw-r--r--Calamity/HTTP/MiscRoutes.hs (renamed from src/Calamity/HTTP/MiscRoutes.hs)0
-rw-r--r--Calamity/HTTP/Reason.hs (renamed from src/Calamity/HTTP/Reason.hs)0
-rw-r--r--Calamity/HTTP/User.hs (renamed from src/Calamity/HTTP/User.hs)0
-rw-r--r--Calamity/HTTP/Webhook.hs (renamed from src/Calamity/HTTP/Webhook.hs)0
-rw-r--r--Calamity/Internal/AesonThings.hs (renamed from src/Calamity/Internal/AesonThings.hs)0
-rw-r--r--Calamity/Internal/BoundedStore.hs (renamed from src/Calamity/Internal/BoundedStore.hs)0
-rw-r--r--Calamity/Internal/ConstructorName.hs (renamed from src/Calamity/Internal/ConstructorName.hs)0
-rw-r--r--Calamity/Internal/IntColour.hs (renamed from src/Calamity/Internal/IntColour.hs)0
-rw-r--r--Calamity/Internal/LocalWriter.hs (renamed from src/Calamity/Internal/LocalWriter.hs)0
-rw-r--r--Calamity/Internal/RunIntoIO.hs (renamed from src/Calamity/Internal/RunIntoIO.hs)0
-rw-r--r--Calamity/Internal/SnowflakeMap.hs (renamed from src/Calamity/Internal/SnowflakeMap.hs)0
-rw-r--r--Calamity/Internal/Updateable.hs (renamed from src/Calamity/Internal/Updateable.hs)0
-rw-r--r--Calamity/Internal/Utils.hs (renamed from src/Calamity/Internal/Utils.hs)0
-rw-r--r--Calamity/Metrics/Eff.hs (renamed from src/Calamity/Metrics/Eff.hs)0
-rw-r--r--Calamity/Metrics/Internal.hs (renamed from src/Calamity/Metrics/Internal.hs)0
-rw-r--r--Calamity/Metrics/Noop.hs (renamed from src/Calamity/Metrics/Noop.hs)0
-rw-r--r--Calamity/Types.hs (renamed from src/Calamity/Types.hs)0
-rw-r--r--Calamity/Types/LogEff.hs (renamed from src/Calamity/Types/LogEff.hs)0
-rw-r--r--Calamity/Types/Model.hs (renamed from src/Calamity/Types/Model.hs)0
-rw-r--r--Calamity/Types/Model/Channel.hs (renamed from src/Calamity/Types/Model/Channel.hs)0
-rw-r--r--Calamity/Types/Model/Channel.hs-boot (renamed from src/Calamity/Types/Model/Channel.hs-boot)0
-rw-r--r--Calamity/Types/Model/Channel/Attachment.hs (renamed from src/Calamity/Types/Model/Channel/Attachment.hs)0
-rw-r--r--Calamity/Types/Model/Channel/ChannelType.hs (renamed from src/Calamity/Types/Model/Channel/ChannelType.hs)0
-rw-r--r--Calamity/Types/Model/Channel/DM.hs (renamed from src/Calamity/Types/Model/Channel/DM.hs)0
-rw-r--r--Calamity/Types/Model/Channel/Embed.hs (renamed from src/Calamity/Types/Model/Channel/Embed.hs)0
-rw-r--r--Calamity/Types/Model/Channel/Group.hs (renamed from src/Calamity/Types/Model/Channel/Group.hs)0
-rw-r--r--Calamity/Types/Model/Channel/Guild.hs (renamed from src/Calamity/Types/Model/Channel/Guild.hs)0
-rw-r--r--Calamity/Types/Model/Channel/Guild/Category.hs (renamed from src/Calamity/Types/Model/Channel/Guild/Category.hs)0
-rw-r--r--Calamity/Types/Model/Channel/Guild/Category.hs-boot (renamed from src/Calamity/Types/Model/Channel/Guild/Category.hs-boot)0
-rw-r--r--Calamity/Types/Model/Channel/Guild/Text.hs (renamed from src/Calamity/Types/Model/Channel/Guild/Text.hs)0
-rw-r--r--Calamity/Types/Model/Channel/Guild/Voice.hs (renamed from src/Calamity/Types/Model/Channel/Guild/Voice.hs)0
-rw-r--r--Calamity/Types/Model/Channel/Message.hs (renamed from src/Calamity/Types/Model/Channel/Message.hs)0
-rw-r--r--Calamity/Types/Model/Channel/Message.hs-boot (renamed from src/Calamity/Types/Model/Channel/Message.hs-boot)0
-rw-r--r--Calamity/Types/Model/Channel/Reaction.hs (renamed from src/Calamity/Types/Model/Channel/Reaction.hs)0
-rw-r--r--Calamity/Types/Model/Channel/UpdatedMessage.hs (renamed from src/Calamity/Types/Model/Channel/UpdatedMessage.hs)0
-rw-r--r--Calamity/Types/Model/Channel/Webhook.hs (renamed from src/Calamity/Types/Model/Channel/Webhook.hs)0
-rw-r--r--Calamity/Types/Model/Guild.hs (renamed from src/Calamity/Types/Model/Guild.hs)0
-rw-r--r--Calamity/Types/Model/Guild/AuditLog.hs (renamed from src/Calamity/Types/Model/Guild/AuditLog.hs)0
-rw-r--r--Calamity/Types/Model/Guild/Ban.hs (renamed from src/Calamity/Types/Model/Guild/Ban.hs)0
-rw-r--r--Calamity/Types/Model/Guild/Emoji.hs (renamed from src/Calamity/Types/Model/Guild/Emoji.hs)0
-rw-r--r--Calamity/Types/Model/Guild/Guild.hs (renamed from src/Calamity/Types/Model/Guild/Guild.hs)0
-rw-r--r--Calamity/Types/Model/Guild/Guild.hs-boot (renamed from src/Calamity/Types/Model/Guild/Guild.hs-boot)0
-rw-r--r--Calamity/Types/Model/Guild/Invite.hs (renamed from src/Calamity/Types/Model/Guild/Invite.hs)0
-rw-r--r--Calamity/Types/Model/Guild/Member.hs (renamed from src/Calamity/Types/Model/Guild/Member.hs)0
-rw-r--r--Calamity/Types/Model/Guild/Member.hs-boot (renamed from src/Calamity/Types/Model/Guild/Member.hs-boot)0
-rw-r--r--Calamity/Types/Model/Guild/Overwrite.hs (renamed from src/Calamity/Types/Model/Guild/Overwrite.hs)0
-rw-r--r--Calamity/Types/Model/Guild/Permissions.hs (renamed from src/Calamity/Types/Model/Guild/Permissions.hs)0
-rw-r--r--Calamity/Types/Model/Guild/Role.hs (renamed from src/Calamity/Types/Model/Guild/Role.hs)0
-rw-r--r--Calamity/Types/Model/Guild/UnavailableGuild.hs (renamed from src/Calamity/Types/Model/Guild/UnavailableGuild.hs)0
-rw-r--r--Calamity/Types/Model/Presence.hs (renamed from src/Calamity/Types/Model/Presence.hs)0
-rw-r--r--Calamity/Types/Model/Presence/Activity.hs (renamed from src/Calamity/Types/Model/Presence/Activity.hs)0
-rw-r--r--Calamity/Types/Model/Presence/Presence.hs (renamed from src/Calamity/Types/Model/Presence/Presence.hs)6
-rw-r--r--Calamity/Types/Model/User.hs (renamed from src/Calamity/Types/Model/User.hs)0
-rw-r--r--Calamity/Types/Model/Voice.hs (renamed from src/Calamity/Types/Model/Voice.hs)0
-rw-r--r--Calamity/Types/Model/Voice/VoiceRegion.hs (renamed from src/Calamity/Types/Model/Voice/VoiceRegion.hs)0
-rw-r--r--Calamity/Types/Model/Voice/VoiceState.hs (renamed from src/Calamity/Types/Model/Voice/VoiceState.hs)0
-rw-r--r--Calamity/Types/Partial.hs (renamed from src/Calamity/Types/Partial.hs)0
-rw-r--r--Calamity/Types/Snowflake.hs (renamed from src/Calamity/Types/Snowflake.hs)0
-rw-r--r--Calamity/Types/Tellable.hs (renamed from src/Calamity/Types/Tellable.hs)0
-rw-r--r--Calamity/Types/Token.hs (renamed from src/Calamity/Types/Token.hs)0
-rw-r--r--Calamity/Types/UnixTimestamp.hs (renamed from src/Calamity/Types/UnixTimestamp.hs)0
-rw-r--r--Calamity/Types/Upgradeable.hs (renamed from src/Calamity/Types/Upgradeable.hs)0
-rw-r--r--Calamity/Utils.hs (renamed from src/Calamity/Utils.hs)0
-rw-r--r--Calamity/Utils/Colour.hs (renamed from src/Calamity/Utils/Colour.hs)0
-rw-r--r--Calamity/Utils/Message.hs (renamed from src/Calamity/Utils/Message.hs)0
-rw-r--r--Calamity/Utils/Permissions.hs (renamed from src/Calamity/Utils/Permissions.hs)0
-rw-r--r--ChangeLog.md7
-rw-r--r--README.md31
-rw-r--r--cabal.project7
-rw-r--r--calamity.cabal23
108 files changed, 86 insertions, 66 deletions
diff --git a/src/Calamity.hs b/Calamity.hs
index efda046..efda046 100644
--- a/src/Calamity.hs
+++ b/Calamity.hs
diff --git a/src/Calamity/Cache/Eff.hs b/Calamity/Cache/Eff.hs
index 90e000e..90e000e 100644
--- a/src/Calamity/Cache/Eff.hs
+++ b/Calamity/Cache/Eff.hs
diff --git a/src/Calamity/Cache/InMemory.hs b/Calamity/Cache/InMemory.hs
index 27c4003..27c4003 100644
--- a/src/Calamity/Cache/InMemory.hs
+++ b/Calamity/Cache/InMemory.hs
diff --git a/src/Calamity/Client.hs b/Calamity/Client.hs
index 0e0391b..0e0391b 100644
--- a/src/Calamity/Client.hs
+++ b/Calamity/Client.hs
diff --git a/src/Calamity/Client/Client.hs b/Calamity/Client/Client.hs
index b1a86e2..c1f0255 100644
--- a/src/Calamity/Client/Client.hs
+++ b/Calamity/Client/Client.hs
@@ -368,6 +368,7 @@ handleEvent shardID data' = do
Right actions -> for_ actions $ \action -> P.async $ do
(time, _) <- timeA . catchAllLogging $ P.embed action
void $ observeHistogram time eventHandleHisto
+ -- pattern match failures are usually stuff like events for uncached guilds, etc
Left err -> debug $ "Failed handling actions for event: " +| err |+ ""
handleEvent' :: BotC r
diff --git a/src/Calamity/Client/ShardManager.hs b/Calamity/Client/ShardManager.hs
index accf778..accf778 100644
--- a/src/Calamity/Client/ShardManager.hs
+++ b/Calamity/Client/ShardManager.hs
diff --git a/src/Calamity/Client/Types.hs b/Calamity/Client/Types.hs
index 2759d40..2759d40 100644
--- a/src/Calamity/Client/Types.hs
+++ b/Calamity/Client/Types.hs
diff --git a/src/Calamity/Commands.hs b/Calamity/Commands.hs
index 7a130a2..7a130a2 100644
--- a/src/Calamity/Commands.hs
+++ b/Calamity/Commands.hs
diff --git a/src/Calamity/Commands/AliasType.hs b/Calamity/Commands/AliasType.hs
index 690adff..690adff 100644
--- a/src/Calamity/Commands/AliasType.hs
+++ b/Calamity/Commands/AliasType.hs
diff --git a/src/Calamity/Commands/Check.hs b/Calamity/Commands/Check.hs
index 1bd5060..1bd5060 100644
--- a/src/Calamity/Commands/Check.hs
+++ b/Calamity/Commands/Check.hs
diff --git a/src/Calamity/Commands/Command.hs b/Calamity/Commands/Command.hs
index 6a59827..6a59827 100644
--- a/src/Calamity/Commands/Command.hs
+++ b/Calamity/Commands/Command.hs
diff --git a/src/Calamity/Commands/Command.hs-boot b/Calamity/Commands/Command.hs-boot
index d0b8257..d0b8257 100644
--- a/src/Calamity/Commands/Command.hs-boot
+++ b/Calamity/Commands/Command.hs-boot
diff --git a/src/Calamity/Commands/CommandUtils.hs b/Calamity/Commands/CommandUtils.hs
index e2362c0..e2362c0 100644
--- a/src/Calamity/Commands/CommandUtils.hs
+++ b/Calamity/Commands/CommandUtils.hs
diff --git a/src/Calamity/Commands/Context.hs b/Calamity/Commands/Context.hs
index 6862c5b..6862c5b 100644
--- a/src/Calamity/Commands/Context.hs
+++ b/Calamity/Commands/Context.hs
diff --git a/src/Calamity/Commands/Context.hs-boot b/Calamity/Commands/Context.hs-boot
index 7a9c7eb..7a9c7eb 100644
--- a/src/Calamity/Commands/Context.hs-boot
+++ b/Calamity/Commands/Context.hs-boot
diff --git a/src/Calamity/Commands/Dsl.hs b/Calamity/Commands/Dsl.hs
index d425183..d425183 100644
--- a/src/Calamity/Commands/Dsl.hs
+++ b/Calamity/Commands/Dsl.hs
diff --git a/src/Calamity/Commands/Error.hs b/Calamity/Commands/Error.hs
index 3c66b3d..3c66b3d 100644
--- a/src/Calamity/Commands/Error.hs
+++ b/Calamity/Commands/Error.hs
diff --git a/src/Calamity/Commands/Group.hs b/Calamity/Commands/Group.hs
index c745023..c745023 100644
--- a/src/Calamity/Commands/Group.hs
+++ b/Calamity/Commands/Group.hs
diff --git a/src/Calamity/Commands/Handler.hs b/Calamity/Commands/Handler.hs
index b590f49..b590f49 100644
--- a/src/Calamity/Commands/Handler.hs
+++ b/Calamity/Commands/Handler.hs
diff --git a/src/Calamity/Commands/Help.hs b/Calamity/Commands/Help.hs
index 96b74dc..96b74dc 100644
--- a/src/Calamity/Commands/Help.hs
+++ b/Calamity/Commands/Help.hs
diff --git a/src/Calamity/Commands/ParsePrefix.hs b/Calamity/Commands/ParsePrefix.hs
index eed2d89..eed2d89 100644
--- a/src/Calamity/Commands/ParsePrefix.hs
+++ b/Calamity/Commands/ParsePrefix.hs
diff --git a/src/Calamity/Commands/Parser.hs b/Calamity/Commands/Parser.hs
index d9fe1ed..d9fe1ed 100644
--- a/src/Calamity/Commands/Parser.hs
+++ b/Calamity/Commands/Parser.hs
diff --git a/src/Calamity/Commands/Utils.hs b/Calamity/Commands/Utils.hs
index b9fb9bc..b9fb9bc 100644
--- a/src/Calamity/Commands/Utils.hs
+++ b/Calamity/Commands/Utils.hs
diff --git a/src/Calamity/Gateway.hs b/Calamity/Gateway.hs
index 229b4b6..229b4b6 100644
--- a/src/Calamity/Gateway.hs
+++ b/Calamity/Gateway.hs
diff --git a/src/Calamity/Gateway/DispatchEvents.hs b/Calamity/Gateway/DispatchEvents.hs
index 367eda4..367eda4 100644
--- a/src/Calamity/Gateway/DispatchEvents.hs
+++ b/Calamity/Gateway/DispatchEvents.hs
diff --git a/src/Calamity/Gateway/Intents.hs b/Calamity/Gateway/Intents.hs
index e24e1c6..e24e1c6 100644
--- a/src/Calamity/Gateway/Intents.hs
+++ b/Calamity/Gateway/Intents.hs
diff --git a/src/Calamity/Gateway/Shard.hs b/Calamity/Gateway/Shard.hs
index 80bd660..43f0907 100644
--- a/src/Calamity/Gateway/Shard.hs
+++ b/Calamity/Gateway/Shard.hs
@@ -57,7 +57,7 @@ import TextShow (showtl)
import Prelude hiding (error)
runWebsocket ::
- P.Members '[P.Final IO, P.Embed IO] r =>
+ P.Members '[LogEff, P.Final IO, P.Embed IO] r =>
L.Text ->
L.Text ->
(Connection -> P.Sem r a) ->
@@ -67,21 +67,26 @@ runWebsocket host path ma = do
-- We have to do this all ourself I think?
-- TODO: see if this isn't needed
+ let logExc e = debug $ "runWebsocket raised with " +|| e ||+ ""
+ logExc' <- bindSemToIO logExc
+ let handler e = do
+ void $ logExc' e
+ pure Nothing
+
+ P.embed . Ex.handleAny handler $ do
+ ctx <- NC.initConnectionContext
+ certStore <- X509.getSystemCertificateStore
+ let clientParams =
+ (NT.defaultParamsClient (L.unpack host) "443")
+ { NT.clientSupported = def{NT.supportedCiphers = NT.ciphersuite_default}
+ , NT.clientShared =
+ def
+ { NT.sharedCAStore = certStore
+ }
+ }
+ let tlsSettings = NC.TLSSettings clientParams
+ connParams = NC.ConnectionParams (L.unpack host) 443 (Just tlsSettings) Nothing
- ctx <- P.embed NC.initConnectionContext
- certStore <- P.embed X509.getSystemCertificateStore
- let clientParams =
- (NT.defaultParamsClient (L.unpack host) "443")
- { NT.clientSupported = def{NT.supportedCiphers = NT.ciphersuite_default}
- , NT.clientShared =
- def
- { NT.sharedCAStore = certStore
- }
- }
- let tlsSettings = NC.TLSSettings clientParams
- connParams = NC.ConnectionParams (L.unpack host) 443 (Just tlsSettings) Nothing
-
- P.embed $
Ex.bracket
(NC.connectTo ctx connParams)
NC.connectionClose
@@ -206,7 +211,7 @@ shardLoop = do
-- we restart normally when we loop
Nothing -> do
- -- won't happen unless innerloop starts using a non-deterministic effect
+ -- won't happen unless innerloop starts using a non-deterministic effect or connecting to the ws dies
info "Restarting shard (abnormal reasons?)"
pure True
@@ -239,8 +244,8 @@ shardLoop = do
{ token = shard ^. #token
, properties =
IdentifyProps
- { browser = "Calamity: https://github.com/nitros12/calamity"
- , device = "Calamity: https://github.com/nitros12/calamity"
+ { browser = "Calamity: https://github.com/simmsb/calamity"
+ , device = "Calamity: https://github.com/simmsb/calamity"
}
, compress = False
, largeThreshold = 250
diff --git a/src/Calamity/Gateway/Types.hs b/Calamity/Gateway/Types.hs
index 1969133..1969133 100644
--- a/src/Calamity/Gateway/Types.hs
+++ b/Calamity/Gateway/Types.hs
diff --git a/src/Calamity/HTTP.hs b/Calamity/HTTP.hs
index 9f78d31..9f78d31 100644
--- a/src/Calamity/HTTP.hs
+++ b/Calamity/HTTP.hs
diff --git a/src/Calamity/HTTP/AuditLog.hs b/Calamity/HTTP/AuditLog.hs
index 6b00b99..6b00b99 100644
--- a/src/Calamity/HTTP/AuditLog.hs
+++ b/Calamity/HTTP/AuditLog.hs
diff --git a/src/Calamity/HTTP/Channel.hs b/Calamity/HTTP/Channel.hs
index 34743d3..6bcd184 100644
--- a/src/Calamity/HTTP/Channel.hs
+++ b/Calamity/HTTP/Channel.hs
@@ -10,7 +10,8 @@ module Calamity.HTTP.Channel (
ChannelUpdate (..),
AllowedMentionType (..),
AllowedMentions (..),
- ChannelMessagesQuery (..),
+ ChannelMessagesFilter (..),
+ ChannelMessagesLimit (..),
GetReactionsOptions (..),
CreateChannelInviteOptions (..),
GroupDMAddRecipientOptions (..),
@@ -122,7 +123,7 @@ data ChannelUpdate = ChannelUpdate
deriving (Generic, Show, Default)
deriving (ToJSON) via CalamityJSON ChannelUpdate
-data ChannelMessagesQuery
+data ChannelMessagesFilter
= ChannelMessagesAround
{ around :: Snowflake Message
}
@@ -132,11 +133,13 @@ data ChannelMessagesQuery
| ChannelMessagesAfter
{ after :: Snowflake Message
}
- | ChannelMessagesLimit
- { limit :: Int
- }
deriving (Generic, Show)
- deriving (ToJSON) via CalamityJSON ChannelMessagesQuery
+ deriving (ToJSON) via CalamityJSON ChannelMessagesFilter
+
+newtype ChannelMessagesLimit = ChannelMessagesLimit
+ { limit :: Integer
+ }
+ deriving (Generic, Show)
data GetReactionsOptions = GetReactionsOptions
{ before :: Maybe (Snowflake User)
@@ -170,7 +173,7 @@ data ChannelRequest a where
GetChannel :: (HasID Channel c) => c -> ChannelRequest Channel
ModifyChannel :: (HasID Channel c) => c -> ChannelUpdate -> ChannelRequest Channel
DeleteChannel :: (HasID Channel c) => c -> ChannelRequest ()
- GetChannelMessages :: (HasID Channel c) => c -> Maybe ChannelMessagesQuery -> ChannelRequest [Message]
+ GetChannelMessages :: (HasID Channel c) => c -> Maybe ChannelMessagesFilter -> Maybe ChannelMessagesLimit -> ChannelRequest [Message]
CreateReaction :: (HasID Channel c, HasID Message m) => c -> m -> RawEmoji -> ChannelRequest ()
DeleteOwnReaction :: (HasID Channel c, HasID Message m) => c -> m -> RawEmoji -> ChannelRequest ()
DeleteUserReaction :: (HasID Channel c, HasID Message m, HasID User u) => c -> m -> RawEmoji -> u -> ChannelRequest ()
@@ -207,7 +210,7 @@ instance Request (ChannelRequest a) where
route (DeleteChannel (getID -> id)) =
baseRoute id
& buildRoute
- route (GetChannelMessages (getID -> id) _) =
+ route (GetChannelMessages (getID -> id) _ _) =
baseRoute id // S "messages"
& buildRoute
route (GetMessage (getID -> cid) (getID @Message -> mid)) =
@@ -297,14 +300,13 @@ instance Request (ChannelRequest a) where
action (GetChannel _) = getWith
action (ModifyChannel _ p) = putWith' (ReqBodyJson p)
action (DeleteChannel _) = deleteWith
- action (GetChannelMessages _ (Just (ChannelMessagesAround (showt . fromSnowflake -> a)))) =
- getWithP ("around" =: a)
- action (GetChannelMessages _ (Just (ChannelMessagesBefore (showt . fromSnowflake -> a)))) =
- getWithP ("before" =: a)
- action (GetChannelMessages _ (Just (ChannelMessagesAfter (showt . fromSnowflake -> a)))) =
- getWithP ("after" =: a)
- action (GetChannelMessages _ (Just (ChannelMessagesLimit (showt -> a)))) = getWithP ("around" =: a)
- action (GetChannelMessages _ Nothing) = getWith
+ action (GetChannelMessages _ (Just (ChannelMessagesAround (showt . fromSnowflake -> a))) l) =
+ getWithP ("around" =: a <> "limit" =:? (showt . (^. #limit) <$> l))
+ action (GetChannelMessages _ (Just (ChannelMessagesBefore (showt . fromSnowflake -> a))) l) =
+ 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 (GetMessage _ _) = getWith
action CreateReaction{} = putEmpty
action DeleteOwnReaction{} = deleteWith
diff --git a/src/Calamity/HTTP/Emoji.hs b/Calamity/HTTP/Emoji.hs
index cd1f5ce..cd1f5ce 100644
--- a/src/Calamity/HTTP/Emoji.hs
+++ b/Calamity/HTTP/Emoji.hs
diff --git a/src/Calamity/HTTP/Guild.hs b/Calamity/HTTP/Guild.hs
index a15ff9e..a15ff9e 100644
--- a/src/Calamity/HTTP/Guild.hs
+++ b/Calamity/HTTP/Guild.hs
diff --git a/src/Calamity/HTTP/Internal/Ratelimit.hs b/Calamity/HTTP/Internal/Ratelimit.hs
index b7f60bb..b7f60bb 100644
--- a/src/Calamity/HTTP/Internal/Ratelimit.hs
+++ b/Calamity/HTTP/Internal/Ratelimit.hs
diff --git a/src/Calamity/HTTP/Internal/Request.hs b/Calamity/HTTP/Internal/Request.hs
index 9208d09..5294847 100644
--- a/src/Calamity/HTTP/Internal/Request.hs
+++ b/Calamity/HTTP/Internal/Request.hs
@@ -101,7 +101,7 @@ reqConfig =
defaultRequestOptions :: Option 'Https
defaultRequestOptions =
- header "User-Agent" "Calamity (https://github.com/nitros12/calamity)"
+ header "User-Agent" "Calamity (https://github.com/simmsb/calamity)"
<> header "X-RateLimit-Precision" "millisecond"
requestOptions :: Token -> Option 'Https
diff --git a/src/Calamity/HTTP/Internal/Route.hs b/Calamity/HTTP/Internal/Route.hs
index 4101692..4101692 100644
--- a/src/Calamity/HTTP/Internal/Route.hs
+++ b/Calamity/HTTP/Internal/Route.hs
diff --git a/src/Calamity/HTTP/Internal/Types.hs b/Calamity/HTTP/Internal/Types.hs
index f557029..f557029 100644
--- a/src/Calamity/HTTP/Internal/Types.hs
+++ b/Calamity/HTTP/Internal/Types.hs
diff --git a/src/Calamity/HTTP/Invite.hs b/Calamity/HTTP/Invite.hs
index 0a9a508..0a9a508 100644
--- a/src/Calamity/HTTP/Invite.hs
+++ b/Calamity/HTTP/Invite.hs
diff --git a/src/Calamity/HTTP/MiscRoutes.hs b/Calamity/HTTP/MiscRoutes.hs
index a59b1ef..a59b1ef 100644
--- a/src/Calamity/HTTP/MiscRoutes.hs
+++ b/Calamity/HTTP/MiscRoutes.hs
diff --git a/src/Calamity/HTTP/Reason.hs b/Calamity/HTTP/Reason.hs
index 7e2eadb..7e2eadb 100644
--- a/src/Calamity/HTTP/Reason.hs
+++ b/Calamity/HTTP/Reason.hs
diff --git a/src/Calamity/HTTP/User.hs b/Calamity/HTTP/User.hs
index fde871a..fde871a 100644
--- a/src/Calamity/HTTP/User.hs
+++ b/Calamity/HTTP/User.hs
diff --git a/src/Calamity/HTTP/Webhook.hs b/Calamity/HTTP/Webhook.hs
index e28a0c2..e28a0c2 100644
--- a/src/Calamity/HTTP/Webhook.hs
+++ b/Calamity/HTTP/Webhook.hs
diff --git a/src/Calamity/Internal/AesonThings.hs b/Calamity/Internal/AesonThings.hs
index 403c871..403c871 100644
--- a/src/Calamity/Internal/AesonThings.hs
+++ b/Calamity/Internal/AesonThings.hs
diff --git a/src/Calamity/Internal/BoundedStore.hs b/Calamity/Internal/BoundedStore.hs
index 47af548..47af548 100644
--- a/src/Calamity/Internal/BoundedStore.hs
+++ b/Calamity/Internal/BoundedStore.hs
diff --git a/src/Calamity/Internal/ConstructorName.hs b/Calamity/Internal/ConstructorName.hs
index c7fae00..c7fae00 100644
--- a/src/Calamity/Internal/ConstructorName.hs
+++ b/Calamity/Internal/ConstructorName.hs
diff --git a/src/Calamity/Internal/IntColour.hs b/Calamity/Internal/IntColour.hs
index 5484f0c..5484f0c 100644
--- a/src/Calamity/Internal/IntColour.hs
+++ b/Calamity/Internal/IntColour.hs
diff --git a/src/Calamity/Internal/LocalWriter.hs b/Calamity/Internal/LocalWriter.hs
index f1bf58b..f1bf58b 100644
--- a/src/Calamity/Internal/LocalWriter.hs
+++ b/Calamity/Internal/LocalWriter.hs
diff --git a/src/Calamity/Internal/RunIntoIO.hs b/Calamity/Internal/RunIntoIO.hs
index 97e37ed..97e37ed 100644
--- a/src/Calamity/Internal/RunIntoIO.hs
+++ b/Calamity/Internal/RunIntoIO.hs
diff --git a/src/Calamity/Internal/SnowflakeMap.hs b/Calamity/Internal/SnowflakeMap.hs
index b766106..b766106 100644
--- a/src/Calamity/Internal/SnowflakeMap.hs
+++ b/Calamity/Internal/SnowflakeMap.hs
diff --git a/src/Calamity/Internal/Updateable.hs b/Calamity/Internal/Updateable.hs
index cec66e5..cec66e5 100644
--- a/src/Calamity/Internal/Updateable.hs
+++ b/Calamity/Internal/Updateable.hs
diff --git a/src/Calamity/Internal/Utils.hs b/Calamity/Internal/Utils.hs
index fef3033..fef3033 100644
--- a/src/Calamity/Internal/Utils.hs
+++ b/Calamity/Internal/Utils.hs
diff --git a/src/Calamity/Metrics/Eff.hs b/Calamity/Metrics/Eff.hs
index 63350f6..63350f6 100644
--- a/src/Calamity/Metrics/Eff.hs
+++ b/Calamity/Metrics/Eff.hs
diff --git a/src/Calamity/Metrics/Internal.hs b/Calamity/Metrics/Internal.hs
index 1d1e531..1d1e531 100644
--- a/src/Calamity/Metrics/Internal.hs
+++ b/Calamity/Metrics/Internal.hs
diff --git a/src/Calamity/Metrics/Noop.hs b/Calamity/Metrics/Noop.hs
index a5eb9de..a5eb9de 100644
--- a/src/Calamity/Metrics/Noop.hs
+++ b/Calamity/Metrics/Noop.hs
diff --git a/src/Calamity/Types.hs b/Calamity/Types.hs
index 13c27b3..13c27b3 100644
--- a/src/Calamity/Types.hs
+++ b/Calamity/Types.hs
diff --git a/src/Calamity/Types/LogEff.hs b/Calamity/Types/LogEff.hs
index 41f11c9..41f11c9 100644
--- a/src/Calamity/Types/LogEff.hs
+++ b/Calamity/Types/LogEff.hs
diff --git a/src/Calamity/Types/Model.hs b/Calamity/Types/Model.hs
index 818d53b..818d53b 100644
--- a/src/Calamity/Types/Model.hs
+++ b/Calamity/Types/Model.hs
diff --git a/src/Calamity/Types/Model/Channel.hs b/Calamity/Types/Model/Channel.hs
index d31a2c5..d31a2c5 100644
--- a/src/Calamity/Types/Model/Channel.hs
+++ b/Calamity/Types/Model/Channel.hs
diff --git a/src/Calamity/Types/Model/Channel.hs-boot b/Calamity/Types/Model/Channel.hs-boot
index 32ef07c..32ef07c 100644
--- a/src/Calamity/Types/Model/Channel.hs-boot
+++ b/Calamity/Types/Model/Channel.hs-boot
diff --git a/src/Calamity/Types/Model/Channel/Attachment.hs b/Calamity/Types/Model/Channel/Attachment.hs
index cb8762a..cb8762a 100644
--- a/src/Calamity/Types/Model/Channel/Attachment.hs
+++ b/Calamity/Types/Model/Channel/Attachment.hs
diff --git a/src/Calamity/Types/Model/Channel/ChannelType.hs b/Calamity/Types/Model/Channel/ChannelType.hs
index 906d08d..906d08d 100644
--- a/src/Calamity/Types/Model/Channel/ChannelType.hs
+++ b/Calamity/Types/Model/Channel/ChannelType.hs
diff --git a/src/Calamity/Types/Model/Channel/DM.hs b/Calamity/Types/Model/Channel/DM.hs
index c15da2a..c15da2a 100644
--- a/src/Calamity/Types/Model/Channel/DM.hs
+++ b/Calamity/Types/Model/Channel/DM.hs
diff --git a/src/Calamity/Types/Model/Channel/Embed.hs b/Calamity/Types/Model/Channel/Embed.hs
index d70bcc2..d70bcc2 100644
--- a/src/Calamity/Types/Model/Channel/Embed.hs
+++ b/Calamity/Types/Model/Channel/Embed.hs
diff --git a/src/Calamity/Types/Model/Channel/Group.hs b/Calamity/Types/Model/Channel/Group.hs
index f1f61ce..f1f61ce 100644
--- a/src/Calamity/Types/Model/Channel/Group.hs
+++ b/Calamity/Types/Model/Channel/Group.hs
diff --git a/src/Calamity/Types/Model/Channel/Guild.hs b/Calamity/Types/Model/Channel/Guild.hs
index f08317d..f08317d 100644
--- a/src/Calamity/Types/Model/Channel/Guild.hs
+++ b/Calamity/Types/Model/Channel/Guild.hs
diff --git a/src/Calamity/Types/Model/Channel/Guild/Category.hs b/Calamity/Types/Model/Channel/Guild/Category.hs
index 8ce543f..8ce543f 100644
--- a/src/Calamity/Types/Model/Channel/Guild/Category.hs
+++ b/Calamity/Types/Model/Channel/Guild/Category.hs
diff --git a/src/Calamity/Types/Model/Channel/Guild/Category.hs-boot b/Calamity/Types/Model/Channel/Guild/Category.hs-boot
index 28adbdf..28adbdf 100644
--- a/src/Calamity/Types/Model/Channel/Guild/Category.hs-boot
+++ b/Calamity/Types/Model/Channel/Guild/Category.hs-boot
diff --git a/src/Calamity/Types/Model/Channel/Guild/Text.hs b/Calamity/Types/Model/Channel/Guild/Text.hs
index 1de539d..1de539d 100644
--- a/src/Calamity/Types/Model/Channel/Guild/Text.hs
+++ b/Calamity/Types/Model/Channel/Guild/Text.hs
diff --git a/src/Calamity/Types/Model/Channel/Guild/Voice.hs b/Calamity/Types/Model/Channel/Guild/Voice.hs
index d2f77d2..d2f77d2 100644
--- a/src/Calamity/Types/Model/Channel/Guild/Voice.hs
+++ b/Calamity/Types/Model/Channel/Guild/Voice.hs
diff --git a/src/Calamity/Types/Model/Channel/Message.hs b/Calamity/Types/Model/Channel/Message.hs
index 7deb50c..7deb50c 100644
--- a/src/Calamity/Types/Model/Channel/Message.hs
+++ b/Calamity/Types/Model/Channel/Message.hs
diff --git a/src/Calamity/Types/Model/Channel/Message.hs-boot b/Calamity/Types/Model/Channel/Message.hs-boot
index 9654e1f..9654e1f 100644
--- a/src/Calamity/Types/Model/Channel/Message.hs-boot
+++ b/Calamity/Types/Model/Channel/Message.hs-boot
diff --git a/src/Calamity/Types/Model/Channel/Reaction.hs b/Calamity/Types/Model/Channel/Reaction.hs
index 16f5bea..16f5bea 100644
--- a/src/Calamity/Types/Model/Channel/Reaction.hs
+++ b/Calamity/Types/Model/Channel/Reaction.hs
diff --git a/src/Calamity/Types/Model/Channel/UpdatedMessage.hs b/Calamity/Types/Model/Channel/UpdatedMessage.hs
index dfe5490..dfe5490 100644
--- a/src/Calamity/Types/Model/Channel/UpdatedMessage.hs
+++ b/Calamity/Types/Model/Channel/UpdatedMessage.hs
diff --git a/src/Calamity/Types/Model/Channel/Webhook.hs b/Calamity/Types/Model/Channel/Webhook.hs
index 5a8fe1e..5a8fe1e 100644
--- a/src/Calamity/Types/Model/Channel/Webhook.hs
+++ b/Calamity/Types/Model/Channel/Webhook.hs
diff --git a/src/Calamity/Types/Model/Guild.hs b/Calamity/Types/Model/Guild.hs
index 00d0682..00d0682 100644
--- a/src/Calamity/Types/Model/Guild.hs
+++ b/Calamity/Types/Model/Guild.hs
diff --git a/src/Calamity/Types/Model/Guild/AuditLog.hs b/Calamity/Types/Model/Guild/AuditLog.hs
index 9af0828..9af0828 100644
--- a/src/Calamity/Types/Model/Guild/AuditLog.hs
+++ b/Calamity/Types/Model/Guild/AuditLog.hs
diff --git a/src/Calamity/Types/Model/Guild/Ban.hs b/Calamity/Types/Model/Guild/Ban.hs
index 29e0377..29e0377 100644
--- a/src/Calamity/Types/Model/Guild/Ban.hs
+++ b/Calamity/Types/Model/Guild/Ban.hs
diff --git a/src/Calamity/Types/Model/Guild/Emoji.hs b/Calamity/Types/Model/Guild/Emoji.hs
index 909a91a..909a91a 100644
--- a/src/Calamity/Types/Model/Guild/Emoji.hs
+++ b/Calamity/Types/Model/Guild/Emoji.hs
diff --git a/src/Calamity/Types/Model/Guild/Guild.hs b/Calamity/Types/Model/Guild/Guild.hs
index ebd91a0..ebd91a0 100644
--- a/src/Calamity/Types/Model/Guild/Guild.hs
+++ b/Calamity/Types/Model/Guild/Guild.hs
diff --git a/src/Calamity/Types/Model/Guild/Guild.hs-boot b/Calamity/Types/Model/Guild/Guild.hs-boot
index 9d90417..9d90417 100644
--- a/src/Calamity/Types/Model/Guild/Guild.hs-boot
+++ b/Calamity/Types/Model/Guild/Guild.hs-boot
diff --git a/src/Calamity/Types/Model/Guild/Invite.hs b/Calamity/Types/Model/Guild/Invite.hs
index 23cd3ee..23cd3ee 100644
--- a/src/Calamity/Types/Model/Guild/Invite.hs
+++ b/Calamity/Types/Model/Guild/Invite.hs
diff --git a/src/Calamity/Types/Model/Guild/Member.hs b/Calamity/Types/Model/Guild/Member.hs
index 6f13634..6f13634 100644
--- a/src/Calamity/Types/Model/Guild/Member.hs
+++ b/Calamity/Types/Model/Guild/Member.hs
diff --git a/src/Calamity/Types/Model/Guild/Member.hs-boot b/Calamity/Types/Model/Guild/Member.hs-boot
index c1f9bf8..c1f9bf8 100644
--- a/src/Calamity/Types/Model/Guild/Member.hs-boot
+++ b/Calamity/Types/Model/Guild/Member.hs-boot
diff --git a/src/Calamity/Types/Model/Guild/Overwrite.hs b/Calamity/Types/Model/Guild/Overwrite.hs
index 71a63ee..71a63ee 100644
--- a/src/Calamity/Types/Model/Guild/Overwrite.hs
+++ b/Calamity/Types/Model/Guild/Overwrite.hs
diff --git a/src/Calamity/Types/Model/Guild/Permissions.hs b/Calamity/Types/Model/Guild/Permissions.hs
index 93401fa..93401fa 100644
--- a/src/Calamity/Types/Model/Guild/Permissions.hs
+++ b/Calamity/Types/Model/Guild/Permissions.hs
diff --git a/src/Calamity/Types/Model/Guild/Role.hs b/Calamity/Types/Model/Guild/Role.hs
index baeb614..baeb614 100644
--- a/src/Calamity/Types/Model/Guild/Role.hs
+++ b/Calamity/Types/Model/Guild/Role.hs
diff --git a/src/Calamity/Types/Model/Guild/UnavailableGuild.hs b/Calamity/Types/Model/Guild/UnavailableGuild.hs
index 02d0c09..02d0c09 100644
--- a/src/Calamity/Types/Model/Guild/UnavailableGuild.hs
+++ b/Calamity/Types/Model/Guild/UnavailableGuild.hs
diff --git a/src/Calamity/Types/Model/Presence.hs b/Calamity/Types/Model/Presence.hs
index 7a51e87..7a51e87 100644
--- a/src/Calamity/Types/Model/Presence.hs
+++ b/Calamity/Types/Model/Presence.hs
diff --git a/src/Calamity/Types/Model/Presence/Activity.hs b/Calamity/Types/Model/Presence/Activity.hs
index 95a44cd..95a44cd 100644
--- a/src/Calamity/Types/Model/Presence/Activity.hs
+++ b/Calamity/Types/Model/Presence/Activity.hs
diff --git a/src/Calamity/Types/Model/Presence/Presence.hs b/Calamity/Types/Model/Presence/Presence.hs
index 5e1468d..0c2d2c9 100644
--- a/src/Calamity/Types/Model/Presence/Presence.hs
+++ b/Calamity/Types/Model/Presence/Presence.hs
@@ -11,8 +11,6 @@ import Calamity.Types.Model.User
import Calamity.Types.Snowflake
import Control.DeepSeq (NFData)
import Data.Aeson
-import qualified Data.Override as O
-import Data.Override.Aeson ()
import Data.Text.Lazy (Text)
import GHC.Generics
import TextShow
@@ -28,10 +26,6 @@ data Presence = Presence
deriving (Eq, Show, Generic, NFData)
deriving (TextShow) via TSG.FromGeneric Presence
deriving
- (ToJSON)
- via CalamityJSON
- (O.Override Presence '["user" `O.As` Partial User])
- deriving
(FromJSON)
via WithSpecialCases
'["user" `ExtractFieldFrom` "id"]
diff --git a/src/Calamity/Types/Model/User.hs b/Calamity/Types/Model/User.hs
index 6417b59..6417b59 100644
--- a/src/Calamity/Types/Model/User.hs
+++ b/Calamity/Types/Model/User.hs
diff --git a/src/Calamity/Types/Model/Voice.hs b/Calamity/Types/Model/Voice.hs
index f7cd8b6..f7cd8b6 100644
--- a/src/Calamity/Types/Model/Voice.hs
+++ b/Calamity/Types/Model/Voice.hs
diff --git a/src/Calamity/Types/Model/Voice/VoiceRegion.hs b/Calamity/Types/Model/Voice/VoiceRegion.hs
index 4aca3f2..4aca3f2 100644
--- a/src/Calamity/Types/Model/Voice/VoiceRegion.hs
+++ b/Calamity/Types/Model/Voice/VoiceRegion.hs
diff --git a/src/Calamity/Types/Model/Voice/VoiceState.hs b/Calamity/Types/Model/Voice/VoiceState.hs
index aac1139..aac1139 100644
--- a/src/Calamity/Types/Model/Voice/VoiceState.hs
+++ b/Calamity/Types/Model/Voice/VoiceState.hs
diff --git a/src/Calamity/Types/Partial.hs b/Calamity/Types/Partial.hs
index fb97fb4..fb97fb4 100644
--- a/src/Calamity/Types/Partial.hs
+++ b/Calamity/Types/Partial.hs
diff --git a/src/Calamity/Types/Snowflake.hs b/Calamity/Types/Snowflake.hs
index 0ac2e16..0ac2e16 100644
--- a/src/Calamity/Types/Snowflake.hs
+++ b/Calamity/Types/Snowflake.hs
diff --git a/src/Calamity/Types/Tellable.hs b/Calamity/Types/Tellable.hs
index f5c69f3..f5c69f3 100644
--- a/src/Calamity/Types/Tellable.hs
+++ b/Calamity/Types/Tellable.hs
diff --git a/src/Calamity/Types/Token.hs b/Calamity/Types/Token.hs
index 44f9c86..44f9c86 100644
--- a/src/Calamity/Types/Token.hs
+++ b/Calamity/Types/Token.hs
diff --git a/src/Calamity/Types/UnixTimestamp.hs b/Calamity/Types/UnixTimestamp.hs
index 0c1b83a..0c1b83a 100644
--- a/src/Calamity/Types/UnixTimestamp.hs
+++ b/Calamity/Types/UnixTimestamp.hs
diff --git a/src/Calamity/Types/Upgradeable.hs b/Calamity/Types/Upgradeable.hs
index 97de219..97de219 100644
--- a/src/Calamity/Types/Upgradeable.hs
+++ b/Calamity/Types/Upgradeable.hs
diff --git a/src/Calamity/Utils.hs b/Calamity/Utils.hs
index 76bfb68..76bfb68 100644
--- a/src/Calamity/Utils.hs
+++ b/Calamity/Utils.hs
diff --git a/src/Calamity/Utils/Colour.hs b/Calamity/Utils/Colour.hs
index 8d0a788..8d0a788 100644
--- a/src/Calamity/Utils/Colour.hs
+++ b/Calamity/Utils/Colour.hs
diff --git a/src/Calamity/Utils/Message.hs b/Calamity/Utils/Message.hs
index 23cdb64..23cdb64 100644
--- a/src/Calamity/Utils/Message.hs
+++ b/Calamity/Utils/Message.hs
diff --git a/src/Calamity/Utils/Permissions.hs b/Calamity/Utils/Permissions.hs
index a928087..a928087 100644
--- a/src/Calamity/Utils/Permissions.hs
+++ b/Calamity/Utils/Permissions.hs
diff --git a/ChangeLog.md b/ChangeLog.md
index 33710cf..77b2378 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,12 @@
# Changelog for Calamity
+## 0.1.26.0
+
++ `GetChannelMessages` now has an extra parameter to allow the `limit` option to
+ be applied at the same time as the other filters.
++ `ChannelMessagesQuery` has been renamed to `ChannelMessagesFilter`.
++ The `ChannelMessagesLimit` type has been introduced.
+
## 0.1.25.1
+ Add `Upgradeable` instances for `VoiceChannnel`, `DMChannel`_, `GroupChannel`,
diff --git a/README.md b/README.md
index e4e9dc1..375e98f 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
<p align="center">
<a href="https://hackage.haskell.org/package/calamity"><img src="https://img.shields.io/hackage/v/calamity" alt="Hackage"></a>
- <a href="https://gitlab.com/nitros12/calamity/pipelines"><img src="https://img.shields.io/gitlab/pipeline/nitros12/calamity" alt="Gitlab pipeline status"></a>
- <a href="https://github.com/nitros12/calamity/blob/master/LICENSE"><img src="https://img.shields.io/github/license/nitros12/calamity" alt="License"></a>
+ <a href="https://gitlab.com/simmsb/calamity/pipelines"><img src="https://img.shields.io/gitlab/pipeline/simmsb/calamity" alt="Gitlab pipeline status"></a>
+ <a href="https://github.com/simmsb/calamity/blob/master/LICENSE"><img src="https://img.shields.io/github/license/simmsb/calamity" alt="License"></a>
<a href="https://hackage.haskell.org/package/calamity"><img src="https://img.shields.io/hackage-deps/v/calamity" alt="Hackage-Deps"></a>
<a href="https://discord.gg/NGCThCY"><img src="https://discord.com/api/guilds/754446998077178088/widget.png?style=shield" alt="Discord Invite"></a>
</p>
@@ -13,6 +13,10 @@ Calamity is a Haskell library for writing discord bots, it uses
handling effects, allowing you to pick and choose how to handle certain features
of the library.
+If you're looking for something with a less complicated interface, you might
+want to take a look at
+[discord-haskell](https://github.com/aquarial/discord-haskell).
+
The current customisable effects are:
* Cache: The default cache handler keeps the cache in memory, however you could
@@ -22,7 +26,7 @@ The current customisable effects are:
useful things, by default these are not used (and cost nothing), but could be
combined with [Prometheus](https://hackage.haskell.org/package/prometheus). An
example of using prometheus as the metrics handler can be found
- [here](https://github.com/nitros12/calamity-example).
+ [here](https://github.com/simmsb/calamity-example).
* Logging: The [di-polysemy](https://hackage.haskell.org/package/di-polysemy)
library is used to allow the logging effect to be customized, or disabled.
@@ -34,8 +38,8 @@ You can find documentation on hackage at: https://hackage.haskell.org/package/ca
# Examples
Some example projects can be found at:
-<!-- - [nitros12/calamity-example](https://github.com/nitros12/calamity-example): An extended example of the snippet below, shows use of metrics. -->
-- [nitros12/calamity-bot](https://github.com/nitros12/calamity-bot): Uses a database, showing modularisation of groups/commands.
+<!-- - [simmsb/calamity-example](https://github.com/simmsb/calamity-example): An extended example of the snippet below, shows use of metrics. -->
+- [simmsb/calamity-bot](https://github.com/simmsb/calamity-bot): Uses a database, showing modularisation of groups/commands.
``` haskell
{-# LANGUAGE DataKinds #-}
@@ -161,3 +165,20 @@ main = do
react @('CustomEvt "my-event" (L.Text, Message)) $ \(s, m) ->
void $ tellt m ("Somebody told me to tell you about: " <> s)
```
+
+## Disabling library logging
+
+The library logs on debug levels by default, if you wish to disable logging you
+can do something along the lines of:
+
+``` haskell
+Di.new $ \di ->
+-- ...
+ . runDiToIO di
+ -- disable logs emitted inside calamity
+ . DiPolysemy.local (Di.Core.filter (\_ _ _ -> False))
+ . runBotIO -- ...
+ -- re-enable logs emitted inside your bot's code
+ . DiPolysemy.local (const di)
+```
+
diff --git a/cabal.project b/cabal.project
deleted file mode 100644
index 76fcb20..0000000
--- a/cabal.project
+++ /dev/null
@@ -1,7 +0,0 @@
--- Generated by stackage-to-hackage
-
-with-compiler: ghc
-
-packages:
- ./
-
diff --git a/calamity.cabal b/calamity.cabal
index b2fe54e..cf9f4f8 100644
--- a/calamity.cabal
+++ b/calamity.cabal
@@ -4,32 +4,31 @@ cabal-version: 1.18
--
-- see: https://github.com/sol/hpack
--
--- hash: 6e705665b05a2018fff8c2a198b5edffcc7cdb2c34a9f83425214c5d2b04a62e
+-- hash: a1e915ba8a1a42f16586860ef601fb5dd7545de1073ccc98e940cf37539c35fe
name: calamity
-version: 0.1.25.1
+version: 0.1.26.0
synopsis: A library for writing discord bots in haskell
-description: Please see the README on GitHub at <https://github.com/nitros12/calamity#readme>
+description: Please see the README on GitHub at <https://github.com/simmsb/calamity#readme>
category: Network, Web
-homepage: https://github.com/nitros12/calamity
-bug-reports: https://github.com/nitros12/calamity/issues
+homepage: https://github.com/simmsb/calamity
+bug-reports: https://github.com/simmsb/calamity/issues
author: Ben Simms
maintainer: ben@bensimms.moe
copyright: 2020 Ben Simms
license: MIT
license-file: LICENSE
-tested-with: GHC == 8.8.3
+tested-with: GHC == 8.10.4
build-type: Simple
extra-source-files:
README.md
ChangeLog.md
- cabal.project
extra-doc-files:
README.md
source-repository head
type: git
- location: https://github.com/nitros12/calamity
+ location: https://github.com/simmsb/calamity
library
exposed-modules:
@@ -133,7 +132,7 @@ library
other-modules:
Paths_calamity
hs-source-dirs:
- src
+ ./.
default-extensions: StrictData AllowAmbiguousTypes BlockArguments NoMonomorphismRestriction BangPatterns BinaryLiterals UndecidableInstances ConstraintKinds DataKinds DefaultSignatures DeriveDataTypeable DeriveFoldable DeriveFunctor DeriveGeneric DeriveTraversable DoAndIfThenElse EmptyDataDecls ExistentialQuantification FlexibleContexts FlexibleInstances FunctionalDependencies GADTs DerivingVia DerivingStrategies GeneralizedNewtypeDeriving StandaloneDeriving DeriveAnyClass InstanceSigs KindSignatures LambdaCase MultiParamTypeClasses MultiWayIf NamedFieldPuns OverloadedStrings OverloadedLabels PartialTypeSignatures PatternGuards PolyKinds RankNTypes RecordWildCards ScopedTypeVariables TupleSections TypeFamilies TypeSynonymInstances ViewPatterns DuplicateRecordFields TypeOperators TypeApplications RoleAnnotations
ghc-options: -fplugin=Polysemy.Plugin -funbox-strict-fields -Wall -fno-warn-name-shadowing
build-depends:
@@ -156,8 +155,6 @@ library
, fmt >=0.6 && <0.7
, focus >=1.0 && <2
, generic-lens >=2.0 && <3
- , generic-override >=0.0.0.0 && <0.0.1
- , generic-override-aeson >=0.0.0.0 && <0.0.1
, hashable >=1.2 && <2
, http-client >=0.5 && <0.8
, http-date >=0.0.8 && <0.1
@@ -168,9 +165,9 @@ library
, mime-types >=0.1 && <0.2
, mtl >=2.2 && <3
, polysemy >=1.3 && <2
- , polysemy-plugin >=0.2 && <0.3
+ , polysemy-plugin >=0.2 && <0.4
, reflection >=2.1 && <3
- , req >=3.1 && <3.9
+ , req >=3.1 && <3.10
, safe-exceptions >=0.1 && <2
, scientific >=0.3 && <0.4
, stm >=2.5 && <3