Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Provides actions for Channel API interactions
Synopsis
- data EmojiRequest a where
- ListGuildEmojis :: GuildId -> EmojiRequest [Emoji]
- GetGuildEmoji :: GuildId -> EmojiId -> EmojiRequest Emoji
- CreateGuildEmoji :: GuildId -> Text -> Base64Image Emoji -> EmojiRequest Emoji
- ModifyGuildEmoji :: GuildId -> EmojiId -> ModifyGuildEmojiOpts -> EmojiRequest Emoji
- DeleteGuildEmoji :: GuildId -> EmojiId -> EmojiRequest ()
- data ModifyGuildEmojiOpts = ModifyGuildEmojiOpts {}
- parseEmojiImage :: ByteString -> Either Text (Base64Image Emoji)
- parseStickerImage :: ByteString -> Either Text (Base64Image Sticker)
- data StickerRequest a where
- GetSticker :: StickerId -> StickerRequest Sticker
- ListNitroStickerPacks :: StickerRequest [StickerPack]
- ListGuildStickers :: GuildId -> StickerRequest [Sticker]
- GetGuildSticker :: GuildId -> StickerId -> StickerRequest Sticker
- CreateGuildSticker :: GuildId -> CreateGuildStickerOpts -> StickerRequest Sticker
- ModifyGuildSticker :: GuildId -> StickerId -> EditGuildStickerOpts -> StickerRequest Sticker
- DeleteGuildSticker :: GuildId -> StickerId -> StickerRequest ()
- data CreateGuildStickerOpts = CreateGuildStickerOpts {}
- data EditGuildStickerOpts = EditGuildStickerOpts {}
Documentation
data EmojiRequest a where Source #
Data constructor for requests. See API
ListGuildEmojis :: GuildId -> EmojiRequest [Emoji] | List of emoji objects for the given guild. Requires MANAGE_EMOJIS permission. |
GetGuildEmoji :: GuildId -> EmojiId -> EmojiRequest Emoji | Emoji object for the given guild and emoji ID |
CreateGuildEmoji :: GuildId -> Text -> Base64Image Emoji -> EmojiRequest Emoji | Create a new guild emoji (static&animated). Requires MANAGE_EMOJIS permission. |
ModifyGuildEmoji :: GuildId -> EmojiId -> ModifyGuildEmojiOpts -> EmojiRequest Emoji | Requires MANAGE_EMOJIS permission |
DeleteGuildEmoji :: GuildId -> EmojiId -> EmojiRequest () | Requires MANAGE_EMOJIS permission |
Instances
Request (EmojiRequest a) Source # | |
Defined in Discord.Internal.Rest.Emoji majorRoute :: EmojiRequest a -> String Source # jsonRequest :: EmojiRequest a -> JsonRequest Source # |
data ModifyGuildEmojiOpts Source #
Instances
parseEmojiImage :: ByteString -> Either Text (Base64Image Emoji) Source #
parseEmojiImage bs
will attempt to convert the given image bytestring bs
to the base64 format expected by the Discord API. It may return Left with an
error reason if either the bytestring is too large, or if the image format
could not be predetermined from the opening few bytes. This function does
not validate the rest of the image, nor check that its dimensions are
128x128 as required by Discord. This is up to the library user to check.
This function accepts all file types accepted by getMimeType
.
parseStickerImage :: ByteString -> Either Text (Base64Image Sticker) Source #
parseStickerImage bs
accepts PNG, APNG, or Lottie JSON bytestring bs
and
will attempt to convert it to the base64 format expected by the Discord API.
It may return Left with an error reason if the image format is unexpected.
This function does not validate the contents of the image, this is up to
the library user to check.
data StickerRequest a where Source #
Data constructor for requests. See API
Be warned that these are untested due to not having a spare server with boosts. Functionality is at your own risk.
GetSticker :: StickerId -> StickerRequest Sticker | Returns a sticker object for the given sticker ID. |
ListNitroStickerPacks :: StickerRequest [StickerPack] | Returns the list of sticker packs available to Nitro subscribers. |
ListGuildStickers :: GuildId -> StickerRequest [Sticker] | Returns an array of sticker objects for the given guild. |
GetGuildSticker :: GuildId -> StickerId -> StickerRequest Sticker | Returns a sticker object for the given guild and sticker ID. |
CreateGuildSticker :: GuildId -> CreateGuildStickerOpts -> StickerRequest Sticker | Create a new sticker for the guild. |
ModifyGuildSticker :: GuildId -> StickerId -> EditGuildStickerOpts -> StickerRequest Sticker | Modify a sticker for a guild. |
DeleteGuildSticker :: GuildId -> StickerId -> StickerRequest () | Delete a guild sticker |
Instances
Request (StickerRequest a) Source # | |
Defined in Discord.Internal.Rest.Emoji majorRoute :: StickerRequest a -> String Source # jsonRequest :: StickerRequest a -> JsonRequest Source # |
data CreateGuildStickerOpts Source #
Options for CreateGuildSticker
Instances
data EditGuildStickerOpts Source #
Options for ModifyGuildSticker