packages feed

discord-haskell 1.6.0 → 1.6.1

raw patch · 13 files changed

+53/−48 lines, 13 filesdep ~JuicyPixelsdep ~MonadRandomdep ~aesonPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: JuicyPixels, MonadRandom, aeson, async, base, base64-bytestring, bytestring, containers, data-default, http-client, iso8601-time, req, safe-exceptions, text, time, unordered-containers, vector, websockets, wuss

API changes (from Hackage documentation)

+ Discord.Internal.Types.Guild: [emojiUser] :: Emoji -> Maybe User
- Discord.Internal.Types.Guild: Emoji :: Maybe EmojiId -> Text -> Maybe [RoleId] -> Maybe Bool -> Emoji
+ Discord.Internal.Types.Guild: Emoji :: Maybe EmojiId -> Text -> Maybe [RoleId] -> Maybe User -> Maybe Bool -> Emoji

Files

README.md view
@@ -128,10 +128,10 @@ #### Official discord docs  For a list of rest requests, gateway events, and gateway sendables go to the -[official discord documentation](https://discordapp.com/developers/docs/intro)+[official discord documentation](https://discord.com/developers/docs/intro)  The rest requests line up very closely. The documentation lists -[Get Channel](https://discordapp.com/developers/docs/resources/channel#get-channel)+[Get Channel](https://discord.com/developers/docs/resources/channel#get-channel) and discord-haskell has `GetChannel :: ChannelId -> ChannelRequest Channel`. Same for gateway `Event`s.  #### Examples
changelog.md view
@@ -2,14 +2,17 @@  View on github for newest version: https://github.com/aquarial/discord-haskell/blob/master/changelog.md -## master+## 1.6.1 -## 1.6.0+Changed discordapp.com to discord.com in accordance with official discord policy  +[rexim](https://github.com/aquarial/discord-haskell/pull/41) Add `Emoji.user` field. Who uploaded the emoji +## 1.6.0+ Add News Channel and StorePage Channel. Fix crash `Unknown channel type:5` -Add NSFW and UserRateLimit+Add NSFW and UserRateLimit to `Channel` type  ## 1.5.1 
discord-haskell.cabal view
@@ -1,9 +1,9 @@ cabal-version:       2.0 name:                discord-haskell -- library version is also noted at src/Discord/Rest/Prelude.hs-version:             1.6.0+version:             1.6.1 description:         Functions and data types to write discord bots.-                     Official discord docs <https://discordapp.com/developers/docs/reference>.+                     Official discord docs <https://discord.com/developers/docs/reference>.                      .                      See the project readme for quickstart notes                      <https://github.com/aquarial/discord-haskell#discord-haskell->@@ -66,24 +66,24 @@                      , Discord.Internal.Types.User                      , Discord.Internal.Types.Embed   build-depends:-                       base >=4 && <5-                     , aeson >=1.3.1.1 && <1.5-                     , async >=2.2.1 && <2.3-                     , bytestring >=0.10.8.2 && <0.11-                     , base64-bytestring >=1.0.0.1 && <1.1-                     , containers >=0.5.11.0 && <0.7-                     , data-default >=0.7.1.1 && <0.8+                       base >= 4 && <5+                     , aeson+                     , async+                     , bytestring+                     , base64-bytestring+                     , containers+                     , data-default                      , emoji == 0.1.0.2-                     , 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 && <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.11-                     , unordered-containers >=0.2.9.0 && <0.3-                     , vector >=0.12.0.1 && <0.13-                     , websockets >=0.12.5.1 && <0.13-                     , wuss >=1.1.10 &&  <1.2+                     , http-client+                     , iso8601-time+                     , MonadRandom+                     , req+                     , JuicyPixels+                     , safe-exceptions+                     , text+                     , time+                     , unordered-containers+                     , vector+                     , websockets+                     , wuss 
src/Discord/Internal/Rest/Channel.hs view
@@ -35,7 +35,7 @@   majorRoute = channelMajorRoute   jsonRequest = channelJsonRequest --- | Data constructor for requests. See <https://discordapp.com/developers/docs/resources/ API>+-- | Data constructor for requests. See <https://discord.com/developers/docs/resources/ API> data ChannelRequest a where   -- | Gets a channel by its id.   GetChannel              :: ChannelId -> ChannelRequest Channel@@ -105,7 +105,7 @@   (AfterReaction snow) -> "after"  R.=: show snow   (LatestReaction) -> mempty --- | Data constructor for GetChannelMessages requests. See <https://discordapp.com/developers/docs/resources/channel#get-channel-messages>+-- | Data constructor for GetChannelMessages requests. See <https://discord.com/developers/docs/resources/channel#get-channel-messages> data MessageTiming = AroundMessage MessageId                    | BeforeMessage MessageId                    | AfterMessage MessageId@@ -171,7 +171,7 @@                                                  , ("deny", toJSON d)                                                  , ("type", toJSON t)] --- | https://discordapp.com/developers/docs/resources/channel#group-dm-add-recipient+-- | https://discord.com/developers/docs/resources/channel#group-dm-add-recipient data GroupDMAddRecipientOpts = GroupDMAddRecipientOpts   { groupDMAddRecipientUserToAdd :: UserId   , groupDMAddRecipientUserToAddNickName :: T.Text@@ -229,7 +229,7 @@  -- | The base url (Req) for API requests baseUrl :: R.Url 'R.Https-baseUrl = R.https "discordapp.com" R./: "api" R./: apiVersion+baseUrl = R.https "discord.com" R./: "api" R./: apiVersion   where apiVersion = "v6"  channels :: R.Url 'R.Https
src/Discord/Internal/Rest/Emoji.hs view
@@ -30,7 +30,7 @@   jsonRequest = emojiJsonRequest  --- | Data constructor for requests. See <https://discordapp.com/developers/docs/resources/ API>+-- | Data constructor for requests. See <https://discord.com/developers/docs/resources/ API> data EmojiRequest a where   -- | List of emoji objects for the given guild. Requires MANAGE_EMOJIS permission.   ListGuildEmojis :: GuildId -> EmojiRequest [Emoji]@@ -87,7 +87,7 @@  -- | The base url (Req) for API requests baseUrl :: R.Url 'R.Https-baseUrl = R.https "discordapp.com" R./: "api" R./: apiVersion+baseUrl = R.https "discord.com" R./: "api" R./: apiVersion   where apiVersion = "v6"  guilds :: R.Url 'R.Https
src/Discord/Internal/Rest/Guild.hs view
@@ -33,7 +33,7 @@   majorRoute = guildMajorRoute   jsonRequest = guildJsonRequest --- | Data constructor for requests. See <https://discordapp.com/developers/docs/resources/ API>+-- | Data constructor for requests. See <https://discord.com/developers/docs/resources/ API> data GuildRequest a where   CreateGuild              :: CreateGuildOpts -> GuildRequest Guild   -- | Returns the new 'Guild' object for the given id@@ -266,7 +266,7 @@                           ,("permission_overwrites", toJSON <$> Just perms)]  --- | https://discordapp.com/developers/docs/resources/guild#modify-guild+-- | https://discord.com/developers/docs/resources/guild#modify-guild data ModifyGuildOpts = ModifyGuildOpts   { modifyGuildOptsName         :: Maybe T.Text   , modifyGuildOptsAFKChannelId :: Maybe ChannelId@@ -342,7 +342,7 @@  -- | The base url (Req) for API requests baseUrl :: R.Url 'R.Https-baseUrl = R.https "discordapp.com" R./: "api" R./: apiVersion+baseUrl = R.https "discord.com" R./: "api" R./: apiVersion   where apiVersion = "v6"  guilds :: R.Url 'R.Https
src/Discord/Internal/Rest/Invite.hs view
@@ -23,7 +23,7 @@   jsonRequest = inviteJsonRequest  --- | Data constructor for requests. See <https://discordapp.com/developers/docs/resources/ API>+-- | Data constructor for requests. See <https://discord.com/developers/docs/resources/ API> data InviteRequest a where   -- | Get invite for given code   GetInvite :: T.Text -> InviteRequest Invite@@ -37,7 +37,7 @@  -- | The base url (Req) for API requests baseUrl :: R.Url 'R.Https-baseUrl = R.https "discordapp.com" R./: "api" R./: apiVersion+baseUrl = R.https "discord.com" R./: "api" R./: apiVersion   where apiVersion = "v6"  invite :: R.Url 'R.Https
src/Discord/Internal/Rest/Prelude.hs view
@@ -23,9 +23,9 @@           R.header "Authorization" (TE.encodeUtf8 (authToken auth))        <> R.header "User-Agent" agent   where-  -- | https://discordapp.com/developers/docs/reference#user-agent+  -- | https://discord.com/developers/docs/reference#user-agent   -- Second place where the library version is noted-  agent = "DiscordBot (https://github.com/aquarial/discord-haskell, 1.6.0)"+  agent = "DiscordBot (https://github.com/aquarial/discord-haskell, 1.6.1)"  -- Append to an URL infixl 5 //
src/Discord/Internal/Rest/User.hs view
@@ -31,7 +31,7 @@   jsonRequest = userJsonRequest  --- | Data constructor for requests. See <https://discordapp.com/developers/docs/resources/ API>+-- | Data constructor for requests. See <https://discord.com/developers/docs/resources/ API> data UserRequest a where   -- | Returns the 'User' object of the requester's account. For OAuth2, this requires   --   the identify scope, which will return the object without an email, and optionally@@ -53,7 +53,7 @@    GetUserConnections   :: UserRequest [ConnectionObject] --- | Formatted avatar data https://discordapp.com/developers/docs/resources/user#avatar-data+-- | Formatted avatar data https://discord.com/developers/docs/resources/user#avatar-data data CurrentUserAvatar = CurrentUserAvatar T.Text  parseCurrentUserAvatar :: B.ByteString -> Either T.Text CurrentUserAvatar@@ -77,7 +77,7 @@  -- | The base url (Req) for API requests baseUrl :: R.Url 'R.Https-baseUrl = R.https "discordapp.com" R./: "api" R./: apiVersion+baseUrl = R.https "discord.com" R./: "api" R./: apiVersion   where apiVersion = "v6"  users :: R.Url 'R.Https
src/Discord/Internal/Rest/Voice.hs view
@@ -20,7 +20,7 @@   majorRoute = voiceMajorRoute   jsonRequest = voiceJsonRequest --- | Data constructor for requests. See <https://discordapp.com/developers/docs/resources/ API>+-- | Data constructor for requests. See <https://discord.com/developers/docs/resources/ API> data VoiceRequest a where   ListVoiceRegions :: VoiceRequest [VoiceRegion] @@ -30,7 +30,7 @@  -- | The base url (Req) for API requests baseUrl :: R.Url 'R.Https-baseUrl = R.https "discordapp.com" R./: "api" R./: apiVersion+baseUrl = R.https "discord.com" R./: "api" R./: apiVersion   where apiVersion = "v6"  voices :: R.Url 'R.Https
src/Discord/Internal/Rest/Webhook.hs view
@@ -30,7 +30,7 @@   majorRoute = webhookMajorRoute   jsonRequest = webhookJsonRequest --- | Data constructor for requests. See <https://discordapp.com/developers/docs/resources/ API>+-- | Data constructor for requests. See <https://discord.com/developers/docs/resources/ API> data WebhookRequest a where   CreateWebhook :: ChannelId -> CreateWebhookOpts -> WebhookRequest Webhook   GetChannelWebhooks :: ChannelId -> WebhookRequest [Webhook]@@ -105,7 +105,7 @@  -- | The base url (Req) for API requests baseUrl :: R.Url 'R.Https-baseUrl = R.https "discordapp.com" R./: "api" R./: apiVersion+baseUrl = R.https "discord.com" R./: "api" R./: apiVersion   where apiVersion = "v6"  webhookJsonRequest :: WebhookRequest r -> JsonRequest
src/Discord/Internal/Types/Events.hs view
@@ -19,7 +19,7 @@ import Discord.Internal.Types.User (User)  --- | Represents possible events sent by discord. Detailed information can be found at https://discordapp.com/developers/docs/topics/gateway.+-- | Represents possible events sent by discord. Detailed information can be found at https://discord.com/developers/docs/topics/gateway. data Event =     Ready                   Int User [Channel] [GuildUnavailable] T.Text   | Resumed                 [T.Text]
src/Discord/Internal/Types/Guild.hs view
@@ -32,7 +32,7 @@                 <*> o .:  "mute"  --- https://discordapp.com/developers/docs/resources/guild#guild-object+-- https://discord.com/developers/docs/resources/guild#guild-object  -- | Guilds in Discord represent a collection of users and channels into an isolated --   "Server"@@ -128,6 +128,7 @@   { emojiId      :: Maybe EmojiId   -- ^ The emoji id   , emojiName    :: T.Text            -- ^ The emoji name   , emojiRoles   :: Maybe [RoleId] -- ^ Roles the emoji is active for+  , emojiUser    :: Maybe User     -- ^ User that created this emoji   , emojiManaged :: Maybe Bool        -- ^ Whether this emoji is managed   } deriving (Show, Eq, Ord) @@ -136,6 +137,7 @@     Emoji <$> o .:  "id"           <*> o .:  "name"           <*> o .:? "roles"+          <*> o .:? "user"           <*> o .:? "managed"  -- | Roles represent a set of permissions attached to a group of users. Roles have unique