discord-haskell 1.4.0 → 1.5.0
raw patch · 5 files changed
+19/−9 lines, 5 filesdep ~reqdep ~timePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: req, time
API changes (from Hackage documentation)
+ Discord.Internal.Types.Prelude: instance GHC.Read.Read Discord.Internal.Types.Prelude.Snowflake
Files
- README.md +4/−3
- changelog.md +4/−0
- discord-haskell.cabal +3/−3
- src/Discord/Internal/Rest/Prelude.hs +1/−1
- src/Discord/Internal/Types/Prelude.hs +7/−2
README.md view
@@ -1,5 +1,7 @@-# discord-haskell [](https://travis-ci.org/aquarial/discord-haskell)+# discord-haskell [](https://travis-ci.org/aquarial/discord-haskell) [](https://hackage.haskell.org/package/discord-haskell) +Build that discord bot in Haskell! This is an example bot that replies "pong" to messages that start with "ping".+ ```haskell {-# LANGUAGE OverloadedStrings #-} -- allows "string literals" to be Text @@ -45,8 +47,7 @@ ```yaml extra-deps: - emoji-0.1.0.2-- discord-haskell-1.2.0- # check hackage for the most recent version+- discord-haskell-VERSION ``` In `project.cabal`
changelog.md view
@@ -5,6 +5,10 @@ ## master +## 1.5.0++[rexim](https://github.com/aquarial/discord-haskell/pull/35) Add `Read` instance for `Snowflake`+ ## 1.4.0 Rename `SubEmbed` to `EmbedPart`
discord-haskell.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.0 name: discord-haskell -- library version is also noted at src/Discord/Rest/Prelude.hs-version: 1.4.0+version: 1.5.0 description: Functions and data types to write discord bots. Official discord docs <https://discordapp.com/developers/docs/reference>. .@@ -77,11 +77,11 @@ , http-client >=0.6.4 && <0.7 , iso8601-time >=0.1.5 && <0.2 , MonadRandom >=0.5.1.1 && <0.6- , req >=2.1.0 && <2.2+ , req >=2.1.0 && <3.2 , JuicyPixels >=3.2.9.5 && <3.4 , safe-exceptions >=0.1.7.0 && <0.2 , text >=1.2.3.0 && <1.3- , time >=1.8.0.2 && <1.9+ , time >=1.8.0.2 && <1.11 , unordered-containers >=0.2.9.0 && <0.3 , vector >=0.12.0.1 && <0.13 , websockets >=0.12.5.1 && <0.13
src/Discord/Internal/Rest/Prelude.hs view
@@ -25,7 +25,7 @@ where -- | https://discordapp.com/developers/docs/reference#user-agent -- Second place where the library version is noted- agent = "DiscordBot (https://github.com/aquarial/discord-haskell, 1.4.0)"+ agent = "DiscordBot (https://github.com/aquarial/discord-haskell, 1.5.0)" -- Append to an URL infixl 5 //
src/Discord/Internal/Types/Prelude.hs view
@@ -14,6 +14,9 @@ import Data.Monoid ((<>)) import Control.Monad (mzero) +import Data.Functor.Compose (Compose(Compose, getCompose))+import Data.Bifunctor (first)+ -- | Authorization token for the Discord API data Auth = Auth T.Text deriving (Show, Eq, Ord)@@ -32,11 +35,14 @@ instance Show Snowflake where show (Snowflake a) = show a +instance Read Snowflake where+ readsPrec p = getCompose $ first Snowflake <$> Compose (readsPrec p)+ instance ToJSON Snowflake where toJSON (Snowflake snowflake) = String . T.pack $ show snowflake instance FromJSON Snowflake where- parseJSON (String snowflake) = Snowflake <$> (pure . read $ T.unpack snowflake)+ parseJSON (String snowflake) = pure . read $ T.unpack snowflake parseJSON _ = mzero type ChannelId = Snowflake@@ -57,4 +63,3 @@ -- | Default timestamp epochTime :: UTCTime epochTime = posixSecondsToUTCTime 0-