discord-haskell-1.17.1: Write bots for Discord in Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Discord.Internal.Rest.Emoji

Description

Provides actions for Channel API interactions

Synopsis

Documentation

data EmojiRequest a where Source #

Data constructor for requests. See API

Constructors

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

Instances details
Request (EmojiRequest a) Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji

data ModifyGuildEmojiOpts Source #

Instances

Instances details
ToJSON ModifyGuildEmojiOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji

Read ModifyGuildEmojiOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji

Show ModifyGuildEmojiOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji

Eq ModifyGuildEmojiOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji

Ord ModifyGuildEmojiOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji

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.

Constructors

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

Instances details
Request (StickerRequest a) Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji

data CreateGuildStickerOpts Source #

Options for CreateGuildSticker

Instances

Instances details
ToJSON CreateGuildStickerOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji

Read CreateGuildStickerOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji

Show CreateGuildStickerOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji

Eq CreateGuildStickerOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji

Ord CreateGuildStickerOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji

data EditGuildStickerOpts Source #

Options for ModifyGuildSticker

Instances

Instances details
ToJSON EditGuildStickerOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji

Read EditGuildStickerOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji

Show EditGuildStickerOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji

Eq EditGuildStickerOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji

Ord EditGuildStickerOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji