discord-haskell-voice 2.2.0 → 2.2.1
raw patch · 4 files changed
+55/−29 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- README.md +32/−10
- discord-haskell-voice.cabal +1/−1
- src/Discord/Internal/Voice.hs +18/−18
ChangeLog.md view
@@ -2,6 +2,10 @@ ## Unreleased changes +## 2.2.1++- Patch README having incorrect non-published details after Hackage publication.+ ## 2.2.0 - Change the definition of `Voice` from a type alias exposing dangerous internal handles, to a newtype wrapper. This also changes the definition of `liftDiscord` to maintain identical behaviour.
README.md view
@@ -1,6 +1,6 @@ # discord-haskell-voice -+  Welcome to `discord-haskell-voice`! This library provides you with a high-level@@ -74,20 +74,42 @@ ## Installation -This library is not published on Hackage or Stackage yet. It is using an-unstable pinned version of the opus package, and until that is properly tested-I do not want to publish it. It is, however available as a package candidate-on Hackage (for viewing Haddock docs).+This library is available on Hackage, at https://hackage.haskell.org/package/discord-haskell-voice. -With Stack, use the `extra-deps` field in your project `stack.yaml` to specify-the Git repo and the commit tag to use.+### Cabal -With Cabal, use the `source-repository-package` stanza in your `cabal.project`-to specify the Git repo and the commit tag to use.+To use it in your Cabal-based project, add `discord-haskell-voice` as a dependency in your `.cabal` file: +```+# --- myproject.cabal <truncated>+ build-depends:+ base >=4.7 && <5+ , discord-haskell ==1.11.0+ , discord-haskell-voice ==2.2.1+```++### Stack++To use it in your Stack-based project, add `discord-haskell-voice` in both your `package.yaml` and `stack.yaml` files (since this library is not available in Stackage for the same reason `discord-haskell` is not on Stackage)++```+# --- stack.yaml <truncated>+extra-deps:+- discord-haskell-1.11.0+- discord-haskell-voice-2.2.1+```++```+# --- package.yaml <truncated>+dependencies:+- base >= 4.7 && < 5+- discord-haskell == 1.11.0+- discord-haskell-voice == 2.2.1+```+ ## Documentation -See the Haddock documentation on the [Hackage package candidate page](https://hackage.haskell.org/package/discord-haskell-voice-2.1.0/candidate).+See the Haddock documentation on the Hackage page, at https://hackage.haskell.org/package/discord-haskell-voice/docs/Discord-Voice.html. ## Future Plans
discord-haskell-voice.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: discord-haskell-voice-version: 2.2.0+version: 2.2.1 synopsis: Voice support for discord-haskell. description: Supplementary library to discord-haskell. See the project README on GitHub for more information. <https://github.com/yutotakano/discord-haskell-voice> category: Network
src/Discord/Internal/Voice.hs view
@@ -93,24 +93,6 @@ import Discord.Internal.Voice.CommonUtils import Discord.Internal.Voice.WebsocketLoop --- | Send a Gateway Websocket Update Voice State command (Opcode 4). Used to--- indicate that the client voice status (deaf/mute) as well as the channel--- they are active on.--- This is not in the Voice monad because it has to be used after all voice--- actions end, to quit the voice channels. It also has no benefit, since it--- would cause extra transformer wrapping/unwrapping.-updateStatusVoice- :: GuildId- -- ^ Id of Guild- -> Maybe ChannelId- -- ^ Id of the voice channel client wants to join (Nothing if disconnecting)- -> Bool- -- ^ Whether the client muted- -> Bool- -- ^ Whether the client deafened- -> DiscordHandler ()-updateStatusVoice a b c d = sendCommand $ UpdateStatusVoice $ UpdateStatusVoiceOpts a b c d- -- | @liftDiscord@ lifts a computation in DiscordHandler into a computation in -- Voice. This is useful for performing DiscordHandler actions inside the -- Voice monad.@@ -329,6 +311,24 @@ , speakingPayloadDelay = 0 , speakingPayloadSSRC = handle ^. ssrc }++-- | Send a Gateway Websocket Update Voice State command (Opcode 4). Used to+-- indicate that the client voice status (deaf/mute) as well as the channel+-- they are active on.+-- This is not in the Voice monad because it has to be used after all voice+-- actions end, to quit the voice channels. It also has no benefit, since it+-- would cause extra transformer wrapping/unwrapping.+updateStatusVoice+ :: GuildId+ -- ^ Id of Guild+ -> Maybe ChannelId+ -- ^ Id of the voice channel client wants to join (Nothing if disconnecting)+ -> Bool+ -- ^ Whether the client muted+ -> Bool+ -- ^ Whether the client deafened+ -> DiscordHandler ()+updateStatusVoice a b c d = sendCommand $ UpdateStatusVoice $ UpdateStatusVoiceOpts a b c d -- | @play source@ plays some sound from the conduit @source@, provided in the -- form of 16-bit Little Endian PCM. The use of Conduit allows you to perform