module Calamity.HTTP.Channel (
ChannelRequest (..),
CreateMessageAttachment (..),
CreateMessageOptions (..),
EditMessageData (..),
editMessageContent,
editMessageEmbeds,
editMessageFlags,
editMessageAllowedMentions,
editMessageComponents,
ChannelUpdate (..),
AllowedMentionType (..),
AllowedMentions (..),
ChannelMessagesFilter (..),
ChannelMessagesLimit (..),
GetReactionsOptions (..),
CreateChannelInviteOptions (..),
GroupDMAddRecipientOptions (..),
) where
import Calamity.HTTP.Internal.Request
import Calamity.HTTP.Internal.Route
import Calamity.Internal.AesonThings
import Calamity.Types.Model.Channel
import Calamity.Types.Model.Guild.Emoji (RawEmoji (..))
import Calamity.Types.Model.Guild.Invite (Invite)
import Calamity.Types.Model.Guild.Overwrite (Overwrite)
import Calamity.Types.Model.Guild.Role (Role)
import Calamity.Types.Model.User
import Calamity.Types.Snowflake
import Control.Lens hiding ((.=))
import Data.Aeson
import qualified Data.Aeson.KeyMap as K
import Data.ByteString.Lazy (ByteString)
import Data.Default.Class
import Data.Maybe (fromMaybe)
import Data.Text (Text)
import qualified Data.Text as T
import Data.Word
import GHC.Generics
import Network.HTTP.Client.MultipartFormData
import Network.HTTP.Req
import Network.Mime
import PyF
import TextShow
data CreateMessageAttachment = CreateMessageAttachment
{ CreateMessageAttachment -> Text
filename :: Text
, CreateMessageAttachment -> Maybe Text
description :: Maybe Text
, CreateMessageAttachment -> ByteString
content :: ByteString
}
deriving (Int -> CreateMessageAttachment -> ShowS
[CreateMessageAttachment] -> ShowS
CreateMessageAttachment -> String
(Int -> CreateMessageAttachment -> ShowS)
-> (CreateMessageAttachment -> String)
-> ([CreateMessageAttachment] -> ShowS)
-> Show CreateMessageAttachment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMessageAttachment] -> ShowS
$cshowList :: [CreateMessageAttachment] -> ShowS
show :: CreateMessageAttachment -> String
$cshow :: CreateMessageAttachment -> String
showsPrec :: Int -> CreateMessageAttachment -> ShowS
$cshowsPrec :: Int -> CreateMessageAttachment -> ShowS
Show, (forall x.
CreateMessageAttachment -> Rep CreateMessageAttachment x)
-> (forall x.
Rep CreateMessageAttachment x -> CreateMessageAttachment)
-> Generic CreateMessageAttachment
forall x. Rep CreateMessageAttachment x -> CreateMessageAttachment
forall x. CreateMessageAttachment -> Rep CreateMessageAttachment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateMessageAttachment x -> CreateMessageAttachment
$cfrom :: forall x. CreateMessageAttachment -> Rep CreateMessageAttachment x
Generic)
data CreateMessageOptions = CreateMessageOptions
{ CreateMessageOptions -> Maybe Text
content :: Maybe Text
, CreateMessageOptions -> Maybe Text
nonce :: Maybe Text
, CreateMessageOptions -> Maybe Bool
tts :: Maybe Bool
, CreateMessageOptions -> Maybe [CreateMessageAttachment]
attachments :: Maybe [CreateMessageAttachment]
, CreateMessageOptions -> Maybe [Embed]
embeds :: Maybe [Embed]
, CreateMessageOptions -> Maybe AllowedMentions
allowedMentions :: Maybe AllowedMentions
, CreateMessageOptions -> Maybe MessageReference
messageReference :: Maybe MessageReference
, CreateMessageOptions -> Maybe [Component]
components :: Maybe [Component]
}
deriving (Int -> CreateMessageOptions -> ShowS
[CreateMessageOptions] -> ShowS
CreateMessageOptions -> String
(Int -> CreateMessageOptions -> ShowS)
-> (CreateMessageOptions -> String)
-> ([CreateMessageOptions] -> ShowS)
-> Show CreateMessageOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMessageOptions] -> ShowS
$cshowList :: [CreateMessageOptions] -> ShowS
show :: CreateMessageOptions -> String
$cshow :: CreateMessageOptions -> String
showsPrec :: Int -> CreateMessageOptions -> ShowS
$cshowsPrec :: Int -> CreateMessageOptions -> ShowS
Show, (forall x. CreateMessageOptions -> Rep CreateMessageOptions x)
-> (forall x. Rep CreateMessageOptions x -> CreateMessageOptions)
-> Generic CreateMessageOptions
forall x. Rep CreateMessageOptions x -> CreateMessageOptions
forall x. CreateMessageOptions -> Rep CreateMessageOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateMessageOptions x -> CreateMessageOptions
$cfrom :: forall x. CreateMessageOptions -> Rep CreateMessageOptions x
Generic, CreateMessageOptions
CreateMessageOptions -> Default CreateMessageOptions
forall a. a -> Default a
def :: CreateMessageOptions
$cdef :: CreateMessageOptions
Default)
data CreateMessageAttachmentJson = CreateMessageAttachmentJson
{ CreateMessageAttachmentJson -> Int
id :: Int
, CreateMessageAttachmentJson -> Text
filename :: Text
, CreateMessageAttachmentJson -> Maybe Text
description :: Maybe Text
}
deriving (Int -> CreateMessageAttachmentJson -> ShowS
[CreateMessageAttachmentJson] -> ShowS
CreateMessageAttachmentJson -> String
(Int -> CreateMessageAttachmentJson -> ShowS)
-> (CreateMessageAttachmentJson -> String)
-> ([CreateMessageAttachmentJson] -> ShowS)
-> Show CreateMessageAttachmentJson
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMessageAttachmentJson] -> ShowS
$cshowList :: [CreateMessageAttachmentJson] -> ShowS
show :: CreateMessageAttachmentJson -> String
$cshow :: CreateMessageAttachmentJson -> String
showsPrec :: Int -> CreateMessageAttachmentJson -> ShowS
$cshowsPrec :: Int -> CreateMessageAttachmentJson -> ShowS
Show, (forall x.
CreateMessageAttachmentJson -> Rep CreateMessageAttachmentJson x)
-> (forall x.
Rep CreateMessageAttachmentJson x -> CreateMessageAttachmentJson)
-> Generic CreateMessageAttachmentJson
forall x.
Rep CreateMessageAttachmentJson x -> CreateMessageAttachmentJson
forall x.
CreateMessageAttachmentJson -> Rep CreateMessageAttachmentJson x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateMessageAttachmentJson x -> CreateMessageAttachmentJson
$cfrom :: forall x.
CreateMessageAttachmentJson -> Rep CreateMessageAttachmentJson x
Generic)
deriving ([CreateMessageAttachmentJson] -> Encoding
[CreateMessageAttachmentJson] -> Value
CreateMessageAttachmentJson -> Encoding
CreateMessageAttachmentJson -> Value
(CreateMessageAttachmentJson -> Value)
-> (CreateMessageAttachmentJson -> Encoding)
-> ([CreateMessageAttachmentJson] -> Value)
-> ([CreateMessageAttachmentJson] -> Encoding)
-> ToJSON CreateMessageAttachmentJson
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [CreateMessageAttachmentJson] -> Encoding
$ctoEncodingList :: [CreateMessageAttachmentJson] -> Encoding
toJSONList :: [CreateMessageAttachmentJson] -> Value
$ctoJSONList :: [CreateMessageAttachmentJson] -> Value
toEncoding :: CreateMessageAttachmentJson -> Encoding
$ctoEncoding :: CreateMessageAttachmentJson -> Encoding
toJSON :: CreateMessageAttachmentJson -> Value
$ctoJSON :: CreateMessageAttachmentJson -> Value
ToJSON) via CalamityJSON CreateMessageAttachmentJson
data CreateMessageJson = CreateMessageJson
{ CreateMessageJson -> Maybe Text
content :: Maybe Text
, CreateMessageJson -> Maybe Text
nonce :: Maybe Text
, CreateMessageJson -> Maybe Bool
tts :: Maybe Bool
, CreateMessageJson -> Maybe [Embed]
embeds :: Maybe [Embed]
, CreateMessageJson -> Maybe AllowedMentions
allowedMentions :: Maybe AllowedMentions
, CreateMessageJson -> Maybe MessageReference
messageReference :: Maybe MessageReference
, CreateMessageJson -> Maybe [Component]
components :: Maybe [Component]
, CreateMessageJson -> Maybe [CreateMessageAttachmentJson]
attachments :: Maybe [CreateMessageAttachmentJson]
}
deriving (Int -> CreateMessageJson -> ShowS
[CreateMessageJson] -> ShowS
CreateMessageJson -> String
(Int -> CreateMessageJson -> ShowS)
-> (CreateMessageJson -> String)
-> ([CreateMessageJson] -> ShowS)
-> Show CreateMessageJson
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMessageJson] -> ShowS
$cshowList :: [CreateMessageJson] -> ShowS
show :: CreateMessageJson -> String
$cshow :: CreateMessageJson -> String
showsPrec :: Int -> CreateMessageJson -> ShowS
$cshowsPrec :: Int -> CreateMessageJson -> ShowS
Show, (forall x. CreateMessageJson -> Rep CreateMessageJson x)
-> (forall x. Rep CreateMessageJson x -> CreateMessageJson)
-> Generic CreateMessageJson
forall x. Rep CreateMessageJson x -> CreateMessageJson
forall x. CreateMessageJson -> Rep CreateMessageJson x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateMessageJson x -> CreateMessageJson
$cfrom :: forall x. CreateMessageJson -> Rep CreateMessageJson x
Generic)
deriving ([CreateMessageJson] -> Encoding
[CreateMessageJson] -> Value
CreateMessageJson -> Encoding
CreateMessageJson -> Value
(CreateMessageJson -> Value)
-> (CreateMessageJson -> Encoding)
-> ([CreateMessageJson] -> Value)
-> ([CreateMessageJson] -> Encoding)
-> ToJSON CreateMessageJson
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [CreateMessageJson] -> Encoding
$ctoEncodingList :: [CreateMessageJson] -> Encoding
toJSONList :: [CreateMessageJson] -> Value
$ctoJSONList :: [CreateMessageJson] -> Value
toEncoding :: CreateMessageJson -> Encoding
$ctoEncoding :: CreateMessageJson -> Encoding
toJSON :: CreateMessageJson -> Value
$ctoJSON :: CreateMessageJson -> Value
ToJSON) via CalamityJSON CreateMessageJson
data AllowedMentionType
= AllowedMentionRoles
| AllowedMentionUsers
| AllowedMentionEveryone
deriving (Int -> AllowedMentionType -> ShowS
[AllowedMentionType] -> ShowS
AllowedMentionType -> String
(Int -> AllowedMentionType -> ShowS)
-> (AllowedMentionType -> String)
-> ([AllowedMentionType] -> ShowS)
-> Show AllowedMentionType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AllowedMentionType] -> ShowS
$cshowList :: [AllowedMentionType] -> ShowS
show :: AllowedMentionType -> String
$cshow :: AllowedMentionType -> String
showsPrec :: Int -> AllowedMentionType -> ShowS
$cshowsPrec :: Int -> AllowedMentionType -> ShowS
Show, (forall x. AllowedMentionType -> Rep AllowedMentionType x)
-> (forall x. Rep AllowedMentionType x -> AllowedMentionType)
-> Generic AllowedMentionType
forall x. Rep AllowedMentionType x -> AllowedMentionType
forall x. AllowedMentionType -> Rep AllowedMentionType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AllowedMentionType x -> AllowedMentionType
$cfrom :: forall x. AllowedMentionType -> Rep AllowedMentionType x
Generic)
instance ToJSON AllowedMentionType where
toJSON :: AllowedMentionType -> Value
toJSON AllowedMentionType
AllowedMentionRoles = Text -> Value
String Text
"roles"
toJSON AllowedMentionType
AllowedMentionUsers = Text -> Value
String Text
"users"
toJSON AllowedMentionType
AllowedMentionEveryone = Text -> Value
String Text
"everyone"
data AllowedMentions = AllowedMentions
{ AllowedMentions -> [AllowedMentionType]
parse :: [AllowedMentionType]
, AllowedMentions -> [Snowflake Role]
roles :: [Snowflake Role]
, AllowedMentions -> [Snowflake User]
users :: [Snowflake User]
, AllowedMentions -> Bool
repliedUser :: Bool
}
deriving (Int -> AllowedMentions -> ShowS
[AllowedMentions] -> ShowS
AllowedMentions -> String
(Int -> AllowedMentions -> ShowS)
-> (AllowedMentions -> String)
-> ([AllowedMentions] -> ShowS)
-> Show AllowedMentions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AllowedMentions] -> ShowS
$cshowList :: [AllowedMentions] -> ShowS
show :: AllowedMentions -> String
$cshow :: AllowedMentions -> String
showsPrec :: Int -> AllowedMentions -> ShowS
$cshowsPrec :: Int -> AllowedMentions -> ShowS
Show, (forall x. AllowedMentions -> Rep AllowedMentions x)
-> (forall x. Rep AllowedMentions x -> AllowedMentions)
-> Generic AllowedMentions
forall x. Rep AllowedMentions x -> AllowedMentions
forall x. AllowedMentions -> Rep AllowedMentions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AllowedMentions x -> AllowedMentions
$cfrom :: forall x. AllowedMentions -> Rep AllowedMentions x
Generic)
deriving ([AllowedMentions] -> Encoding
[AllowedMentions] -> Value
AllowedMentions -> Encoding
AllowedMentions -> Value
(AllowedMentions -> Value)
-> (AllowedMentions -> Encoding)
-> ([AllowedMentions] -> Value)
-> ([AllowedMentions] -> Encoding)
-> ToJSON AllowedMentions
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [AllowedMentions] -> Encoding
$ctoEncodingList :: [AllowedMentions] -> Encoding
toJSONList :: [AllowedMentions] -> Value
$ctoJSONList :: [AllowedMentions] -> Value
toEncoding :: AllowedMentions -> Encoding
$ctoEncoding :: AllowedMentions -> Encoding
toJSON :: AllowedMentions -> Value
$ctoJSON :: AllowedMentions -> Value
ToJSON) via CalamityJSON AllowedMentions
instance Default AllowedMentions where
def :: AllowedMentions
def = [AllowedMentionType]
-> [Snowflake Role] -> [Snowflake User] -> Bool -> AllowedMentions
AllowedMentions [AllowedMentionType]
forall a. Default a => a
def [Snowflake Role]
forall a. Default a => a
def [Snowflake User]
forall a. Default a => a
def Bool
False
instance Semigroup AllowedMentions where
AllowedMentions [AllowedMentionType]
p0 [Snowflake Role]
r0 [Snowflake User]
u0 Bool
ru0 <> :: AllowedMentions -> AllowedMentions -> AllowedMentions
<> AllowedMentions [AllowedMentionType]
p1 [Snowflake Role]
r1 [Snowflake User]
u1 Bool
ru1 =
[AllowedMentionType]
-> [Snowflake Role] -> [Snowflake User] -> Bool -> AllowedMentions
AllowedMentions ([AllowedMentionType]
p0 [AllowedMentionType]
-> [AllowedMentionType] -> [AllowedMentionType]
forall a. Semigroup a => a -> a -> a
<> [AllowedMentionType]
p1) ([Snowflake Role]
r0 [Snowflake Role] -> [Snowflake Role] -> [Snowflake Role]
forall a. Semigroup a => a -> a -> a
<> [Snowflake Role]
r1) ([Snowflake User]
u0 [Snowflake User] -> [Snowflake User] -> [Snowflake User]
forall a. Semigroup a => a -> a -> a
<> [Snowflake User]
u1) (Bool
ru0 Bool -> Bool -> Bool
|| Bool
ru1)
instance Monoid AllowedMentions where
mempty :: AllowedMentions
mempty = AllowedMentions
forall a. Default a => a
def
newtype EditMessageData = EditMessageData Object
deriving (Int -> EditMessageData -> ShowS
[EditMessageData] -> ShowS
EditMessageData -> String
(Int -> EditMessageData -> ShowS)
-> (EditMessageData -> String)
-> ([EditMessageData] -> ShowS)
-> Show EditMessageData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EditMessageData] -> ShowS
$cshowList :: [EditMessageData] -> ShowS
show :: EditMessageData -> String
$cshow :: EditMessageData -> String
showsPrec :: Int -> EditMessageData -> ShowS
$cshowsPrec :: Int -> EditMessageData -> ShowS
Show, (forall x. EditMessageData -> Rep EditMessageData x)
-> (forall x. Rep EditMessageData x -> EditMessageData)
-> Generic EditMessageData
forall x. Rep EditMessageData x -> EditMessageData
forall x. EditMessageData -> Rep EditMessageData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EditMessageData x -> EditMessageData
$cfrom :: forall x. EditMessageData -> Rep EditMessageData x
Generic)
deriving newtype ([EditMessageData] -> Encoding
[EditMessageData] -> Value
EditMessageData -> Encoding
EditMessageData -> Value
(EditMessageData -> Value)
-> (EditMessageData -> Encoding)
-> ([EditMessageData] -> Value)
-> ([EditMessageData] -> Encoding)
-> ToJSON EditMessageData
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [EditMessageData] -> Encoding
$ctoEncodingList :: [EditMessageData] -> Encoding
toJSONList :: [EditMessageData] -> Value
$ctoJSONList :: [EditMessageData] -> Value
toEncoding :: EditMessageData -> Encoding
$ctoEncoding :: EditMessageData -> Encoding
toJSON :: EditMessageData -> Value
$ctoJSON :: EditMessageData -> Value
ToJSON, b -> EditMessageData -> EditMessageData
NonEmpty EditMessageData -> EditMessageData
EditMessageData -> EditMessageData -> EditMessageData
(EditMessageData -> EditMessageData -> EditMessageData)
-> (NonEmpty EditMessageData -> EditMessageData)
-> (forall b.
Integral b =>
b -> EditMessageData -> EditMessageData)
-> Semigroup EditMessageData
forall b. Integral b => b -> EditMessageData -> EditMessageData
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
stimes :: b -> EditMessageData -> EditMessageData
$cstimes :: forall b. Integral b => b -> EditMessageData -> EditMessageData
sconcat :: NonEmpty EditMessageData -> EditMessageData
$csconcat :: NonEmpty EditMessageData -> EditMessageData
<> :: EditMessageData -> EditMessageData -> EditMessageData
$c<> :: EditMessageData -> EditMessageData -> EditMessageData
Semigroup, Semigroup EditMessageData
EditMessageData
Semigroup EditMessageData
-> EditMessageData
-> (EditMessageData -> EditMessageData -> EditMessageData)
-> ([EditMessageData] -> EditMessageData)
-> Monoid EditMessageData
[EditMessageData] -> EditMessageData
EditMessageData -> EditMessageData -> EditMessageData
forall a.
Semigroup a -> a -> (a -> a -> a) -> ([a] -> a) -> Monoid a
mconcat :: [EditMessageData] -> EditMessageData
$cmconcat :: [EditMessageData] -> EditMessageData
mappend :: EditMessageData -> EditMessageData -> EditMessageData
$cmappend :: EditMessageData -> EditMessageData -> EditMessageData
mempty :: EditMessageData
$cmempty :: EditMessageData
$cp1Monoid :: Semigroup EditMessageData
Monoid)
editMessageContent :: Maybe Text -> EditMessageData
editMessageContent :: Maybe Text -> EditMessageData
editMessageContent Maybe Text
v = Object -> EditMessageData
EditMessageData (Object -> EditMessageData) -> Object -> EditMessageData
forall a b. (a -> b) -> a -> b
$ [(Key, Value)] -> Object
forall v. [(Key, v)] -> KeyMap v
K.fromList [(Key
"content", Maybe Text -> Value
forall a. ToJSON a => a -> Value
toJSON Maybe Text
v)]
editMessageEmbeds :: [Embed] -> EditMessageData
editMessageEmbeds :: [Embed] -> EditMessageData
editMessageEmbeds [Embed]
v = Object -> EditMessageData
EditMessageData (Object -> EditMessageData) -> Object -> EditMessageData
forall a b. (a -> b) -> a -> b
$ [(Key, Value)] -> Object
forall v. [(Key, v)] -> KeyMap v
K.fromList [(Key
"embeds", [Embed] -> Value
forall a. ToJSON a => a -> Value
toJSON [Embed]
v)]
editMessageFlags :: Maybe Word64 -> EditMessageData
editMessageFlags :: Maybe Word64 -> EditMessageData
editMessageFlags Maybe Word64
v = Object -> EditMessageData
EditMessageData (Object -> EditMessageData) -> Object -> EditMessageData
forall a b. (a -> b) -> a -> b
$ [(Key, Value)] -> Object
forall v. [(Key, v)] -> KeyMap v
K.fromList [(Key
"flags", Maybe Word64 -> Value
forall a. ToJSON a => a -> Value
toJSON Maybe Word64
v)]
editMessageAllowedMentions :: Maybe AllowedMentions -> EditMessageData
editMessageAllowedMentions :: Maybe AllowedMentions -> EditMessageData
editMessageAllowedMentions Maybe AllowedMentions
v = Object -> EditMessageData
EditMessageData (Object -> EditMessageData) -> Object -> EditMessageData
forall a b. (a -> b) -> a -> b
$ [(Key, Value)] -> Object
forall v. [(Key, v)] -> KeyMap v
K.fromList [(Key
"allowed_mentions", Maybe AllowedMentions -> Value
forall a. ToJSON a => a -> Value
toJSON Maybe AllowedMentions
v)]
editMessageComponents :: [Component] -> EditMessageData
editMessageComponents :: [Component] -> EditMessageData
editMessageComponents [Component]
v = Object -> EditMessageData
EditMessageData (Object -> EditMessageData) -> Object -> EditMessageData
forall a b. (a -> b) -> a -> b
$ [(Key, Value)] -> Object
forall v. [(Key, v)] -> KeyMap v
K.fromList [(Key
"components", [Component] -> Value
forall a. ToJSON a => a -> Value
toJSON [Component]
v)]
data ChannelUpdate = ChannelUpdate
{ ChannelUpdate -> Maybe Text
name :: Maybe Text
, ChannelUpdate -> Maybe Int
position :: Maybe Int
, ChannelUpdate -> Maybe Text
topic :: Maybe Text
, ChannelUpdate -> Maybe Bool
nsfw :: Maybe Bool
, ChannelUpdate -> Maybe Int
rateLimitPerUser :: Maybe Int
, ChannelUpdate -> Maybe Int
bitrate :: Maybe Int
, ChannelUpdate -> Maybe Int
userLimit :: Maybe Int
, ChannelUpdate -> Maybe [Overwrite]
permissionOverwrites :: Maybe [Overwrite]
, ChannelUpdate -> Maybe (Snowflake Channel)
parentID :: Maybe (Snowflake Channel)
}
deriving ((forall x. ChannelUpdate -> Rep ChannelUpdate x)
-> (forall x. Rep ChannelUpdate x -> ChannelUpdate)
-> Generic ChannelUpdate
forall x. Rep ChannelUpdate x -> ChannelUpdate
forall x. ChannelUpdate -> Rep ChannelUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChannelUpdate x -> ChannelUpdate
$cfrom :: forall x. ChannelUpdate -> Rep ChannelUpdate x
Generic, Int -> ChannelUpdate -> ShowS
[ChannelUpdate] -> ShowS
ChannelUpdate -> String
(Int -> ChannelUpdate -> ShowS)
-> (ChannelUpdate -> String)
-> ([ChannelUpdate] -> ShowS)
-> Show ChannelUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelUpdate] -> ShowS
$cshowList :: [ChannelUpdate] -> ShowS
show :: ChannelUpdate -> String
$cshow :: ChannelUpdate -> String
showsPrec :: Int -> ChannelUpdate -> ShowS
$cshowsPrec :: Int -> ChannelUpdate -> ShowS
Show, ChannelUpdate
ChannelUpdate -> Default ChannelUpdate
forall a. a -> Default a
def :: ChannelUpdate
$cdef :: ChannelUpdate
Default)
deriving ([ChannelUpdate] -> Encoding
[ChannelUpdate] -> Value
ChannelUpdate -> Encoding
ChannelUpdate -> Value
(ChannelUpdate -> Value)
-> (ChannelUpdate -> Encoding)
-> ([ChannelUpdate] -> Value)
-> ([ChannelUpdate] -> Encoding)
-> ToJSON ChannelUpdate
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [ChannelUpdate] -> Encoding
$ctoEncodingList :: [ChannelUpdate] -> Encoding
toJSONList :: [ChannelUpdate] -> Value
$ctoJSONList :: [ChannelUpdate] -> Value
toEncoding :: ChannelUpdate -> Encoding
$ctoEncoding :: ChannelUpdate -> Encoding
toJSON :: ChannelUpdate -> Value
$ctoJSON :: ChannelUpdate -> Value
ToJSON) via CalamityJSON ChannelUpdate
data ChannelMessagesFilter
= ChannelMessagesAround
{ ChannelMessagesFilter -> Snowflake Message
around :: Snowflake Message
}
| ChannelMessagesBefore
{ ChannelMessagesFilter -> Snowflake Message
before :: Snowflake Message
}
| ChannelMessagesAfter
{ ChannelMessagesFilter -> Snowflake Message
after :: Snowflake Message
}
deriving ((forall x. ChannelMessagesFilter -> Rep ChannelMessagesFilter x)
-> (forall x. Rep ChannelMessagesFilter x -> ChannelMessagesFilter)
-> Generic ChannelMessagesFilter
forall x. Rep ChannelMessagesFilter x -> ChannelMessagesFilter
forall x. ChannelMessagesFilter -> Rep ChannelMessagesFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChannelMessagesFilter x -> ChannelMessagesFilter
$cfrom :: forall x. ChannelMessagesFilter -> Rep ChannelMessagesFilter x
Generic, Int -> ChannelMessagesFilter -> ShowS
[ChannelMessagesFilter] -> ShowS
ChannelMessagesFilter -> String
(Int -> ChannelMessagesFilter -> ShowS)
-> (ChannelMessagesFilter -> String)
-> ([ChannelMessagesFilter] -> ShowS)
-> Show ChannelMessagesFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelMessagesFilter] -> ShowS
$cshowList :: [ChannelMessagesFilter] -> ShowS
show :: ChannelMessagesFilter -> String
$cshow :: ChannelMessagesFilter -> String
showsPrec :: Int -> ChannelMessagesFilter -> ShowS
$cshowsPrec :: Int -> ChannelMessagesFilter -> ShowS
Show)
deriving ([ChannelMessagesFilter] -> Encoding
[ChannelMessagesFilter] -> Value
ChannelMessagesFilter -> Encoding
ChannelMessagesFilter -> Value
(ChannelMessagesFilter -> Value)
-> (ChannelMessagesFilter -> Encoding)
-> ([ChannelMessagesFilter] -> Value)
-> ([ChannelMessagesFilter] -> Encoding)
-> ToJSON ChannelMessagesFilter
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [ChannelMessagesFilter] -> Encoding
$ctoEncodingList :: [ChannelMessagesFilter] -> Encoding
toJSONList :: [ChannelMessagesFilter] -> Value
$ctoJSONList :: [ChannelMessagesFilter] -> Value
toEncoding :: ChannelMessagesFilter -> Encoding
$ctoEncoding :: ChannelMessagesFilter -> Encoding
toJSON :: ChannelMessagesFilter -> Value
$ctoJSON :: ChannelMessagesFilter -> Value
ToJSON) via CalamityJSON ChannelMessagesFilter
newtype ChannelMessagesLimit = ChannelMessagesLimit
{ ChannelMessagesLimit -> Integer
limit :: Integer
}
deriving ((forall x. ChannelMessagesLimit -> Rep ChannelMessagesLimit x)
-> (forall x. Rep ChannelMessagesLimit x -> ChannelMessagesLimit)
-> Generic ChannelMessagesLimit
forall x. Rep ChannelMessagesLimit x -> ChannelMessagesLimit
forall x. ChannelMessagesLimit -> Rep ChannelMessagesLimit x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChannelMessagesLimit x -> ChannelMessagesLimit
$cfrom :: forall x. ChannelMessagesLimit -> Rep ChannelMessagesLimit x
Generic, Int -> ChannelMessagesLimit -> ShowS
[ChannelMessagesLimit] -> ShowS
ChannelMessagesLimit -> String
(Int -> ChannelMessagesLimit -> ShowS)
-> (ChannelMessagesLimit -> String)
-> ([ChannelMessagesLimit] -> ShowS)
-> Show ChannelMessagesLimit
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelMessagesLimit] -> ShowS
$cshowList :: [ChannelMessagesLimit] -> ShowS
show :: ChannelMessagesLimit -> String
$cshow :: ChannelMessagesLimit -> String
showsPrec :: Int -> ChannelMessagesLimit -> ShowS
$cshowsPrec :: Int -> ChannelMessagesLimit -> ShowS
Show)
data GetReactionsOptions = GetReactionsOptions
{ GetReactionsOptions -> Maybe (Snowflake User)
before :: Maybe (Snowflake User)
, GetReactionsOptions -> Maybe (Snowflake User)
after :: Maybe (Snowflake User)
, GetReactionsOptions -> Maybe Integer
limit :: Maybe Integer
}
deriving (Int -> GetReactionsOptions -> ShowS
[GetReactionsOptions] -> ShowS
GetReactionsOptions -> String
(Int -> GetReactionsOptions -> ShowS)
-> (GetReactionsOptions -> String)
-> ([GetReactionsOptions] -> ShowS)
-> Show GetReactionsOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetReactionsOptions] -> ShowS
$cshowList :: [GetReactionsOptions] -> ShowS
show :: GetReactionsOptions -> String
$cshow :: GetReactionsOptions -> String
showsPrec :: Int -> GetReactionsOptions -> ShowS
$cshowsPrec :: Int -> GetReactionsOptions -> ShowS
Show, (forall x. GetReactionsOptions -> Rep GetReactionsOptions x)
-> (forall x. Rep GetReactionsOptions x -> GetReactionsOptions)
-> Generic GetReactionsOptions
forall x. Rep GetReactionsOptions x -> GetReactionsOptions
forall x. GetReactionsOptions -> Rep GetReactionsOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetReactionsOptions x -> GetReactionsOptions
$cfrom :: forall x. GetReactionsOptions -> Rep GetReactionsOptions x
Generic, GetReactionsOptions
GetReactionsOptions -> Default GetReactionsOptions
forall a. a -> Default a
def :: GetReactionsOptions
$cdef :: GetReactionsOptions
Default)
data CreateChannelInviteOptions = CreateChannelInviteOptions
{ CreateChannelInviteOptions -> Maybe Int
maxAge :: Maybe Int
, CreateChannelInviteOptions -> Maybe Int
maxUses :: Maybe Int
, CreateChannelInviteOptions -> Maybe Bool
temporary :: Maybe Bool
, CreateChannelInviteOptions -> Maybe Bool
unique :: Maybe Bool
}
deriving (Int -> CreateChannelInviteOptions -> ShowS
[CreateChannelInviteOptions] -> ShowS
CreateChannelInviteOptions -> String
(Int -> CreateChannelInviteOptions -> ShowS)
-> (CreateChannelInviteOptions -> String)
-> ([CreateChannelInviteOptions] -> ShowS)
-> Show CreateChannelInviteOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateChannelInviteOptions] -> ShowS
$cshowList :: [CreateChannelInviteOptions] -> ShowS
show :: CreateChannelInviteOptions -> String
$cshow :: CreateChannelInviteOptions -> String
showsPrec :: Int -> CreateChannelInviteOptions -> ShowS
$cshowsPrec :: Int -> CreateChannelInviteOptions -> ShowS
Show, (forall x.
CreateChannelInviteOptions -> Rep CreateChannelInviteOptions x)
-> (forall x.
Rep CreateChannelInviteOptions x -> CreateChannelInviteOptions)
-> Generic CreateChannelInviteOptions
forall x.
Rep CreateChannelInviteOptions x -> CreateChannelInviteOptions
forall x.
CreateChannelInviteOptions -> Rep CreateChannelInviteOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateChannelInviteOptions x -> CreateChannelInviteOptions
$cfrom :: forall x.
CreateChannelInviteOptions -> Rep CreateChannelInviteOptions x
Generic, CreateChannelInviteOptions
CreateChannelInviteOptions -> Default CreateChannelInviteOptions
forall a. a -> Default a
def :: CreateChannelInviteOptions
$cdef :: CreateChannelInviteOptions
Default)
deriving ([CreateChannelInviteOptions] -> Encoding
[CreateChannelInviteOptions] -> Value
CreateChannelInviteOptions -> Encoding
CreateChannelInviteOptions -> Value
(CreateChannelInviteOptions -> Value)
-> (CreateChannelInviteOptions -> Encoding)
-> ([CreateChannelInviteOptions] -> Value)
-> ([CreateChannelInviteOptions] -> Encoding)
-> ToJSON CreateChannelInviteOptions
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [CreateChannelInviteOptions] -> Encoding
$ctoEncodingList :: [CreateChannelInviteOptions] -> Encoding
toJSONList :: [CreateChannelInviteOptions] -> Value
$ctoJSONList :: [CreateChannelInviteOptions] -> Value
toEncoding :: CreateChannelInviteOptions -> Encoding
$ctoEncoding :: CreateChannelInviteOptions -> Encoding
toJSON :: CreateChannelInviteOptions -> Value
$ctoJSON :: CreateChannelInviteOptions -> Value
ToJSON) via CalamityJSON CreateChannelInviteOptions
data GroupDMAddRecipientOptions = GroupDMAddRecipientOptions
{ GroupDMAddRecipientOptions -> Text
accessToken :: Text
, GroupDMAddRecipientOptions -> Text
nick :: Text
}
deriving (Int -> GroupDMAddRecipientOptions -> ShowS
[GroupDMAddRecipientOptions] -> ShowS
GroupDMAddRecipientOptions -> String
(Int -> GroupDMAddRecipientOptions -> ShowS)
-> (GroupDMAddRecipientOptions -> String)
-> ([GroupDMAddRecipientOptions] -> ShowS)
-> Show GroupDMAddRecipientOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GroupDMAddRecipientOptions] -> ShowS
$cshowList :: [GroupDMAddRecipientOptions] -> ShowS
show :: GroupDMAddRecipientOptions -> String
$cshow :: GroupDMAddRecipientOptions -> String
showsPrec :: Int -> GroupDMAddRecipientOptions -> ShowS
$cshowsPrec :: Int -> GroupDMAddRecipientOptions -> ShowS
Show, (forall x.
GroupDMAddRecipientOptions -> Rep GroupDMAddRecipientOptions x)
-> (forall x.
Rep GroupDMAddRecipientOptions x -> GroupDMAddRecipientOptions)
-> Generic GroupDMAddRecipientOptions
forall x.
Rep GroupDMAddRecipientOptions x -> GroupDMAddRecipientOptions
forall x.
GroupDMAddRecipientOptions -> Rep GroupDMAddRecipientOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GroupDMAddRecipientOptions x -> GroupDMAddRecipientOptions
$cfrom :: forall x.
GroupDMAddRecipientOptions -> Rep GroupDMAddRecipientOptions x
Generic)
deriving ([GroupDMAddRecipientOptions] -> Encoding
[GroupDMAddRecipientOptions] -> Value
GroupDMAddRecipientOptions -> Encoding
GroupDMAddRecipientOptions -> Value
(GroupDMAddRecipientOptions -> Value)
-> (GroupDMAddRecipientOptions -> Encoding)
-> ([GroupDMAddRecipientOptions] -> Value)
-> ([GroupDMAddRecipientOptions] -> Encoding)
-> ToJSON GroupDMAddRecipientOptions
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [GroupDMAddRecipientOptions] -> Encoding
$ctoEncodingList :: [GroupDMAddRecipientOptions] -> Encoding
toJSONList :: [GroupDMAddRecipientOptions] -> Value
$ctoJSONList :: [GroupDMAddRecipientOptions] -> Value
toEncoding :: GroupDMAddRecipientOptions -> Encoding
$ctoEncoding :: GroupDMAddRecipientOptions -> Encoding
toJSON :: GroupDMAddRecipientOptions -> Value
$ctoJSON :: GroupDMAddRecipientOptions -> Value
ToJSON) via CalamityJSON GroupDMAddRecipientOptions
data ChannelRequest a where
CreateMessage :: (HasID Channel c) => c -> CreateMessageOptions -> ChannelRequest Message
CrosspostMessage :: (HasID Channel c, HasID Message m) => c -> m -> ChannelRequest Message
GetMessage :: (HasID Channel c, HasID Message m) => c -> m -> ChannelRequest Message
EditMessage :: (HasID Channel c, HasID Message m) => c -> m -> EditMessageData -> ChannelRequest Message
DeleteMessage :: (HasID Channel c, HasID Message m) => c -> m -> ChannelRequest ()
BulkDeleteMessages :: (HasID Channel c, HasID Message m) => c -> [m] -> ChannelRequest ()
GetChannel :: (HasID Channel c) => c -> ChannelRequest Channel
ModifyChannel :: (HasID Channel c) => c -> ChannelUpdate -> ChannelRequest Channel
DeleteChannel :: (HasID Channel c) => c -> ChannelRequest ()
GetChannelMessages :: (HasID Channel c) => c -> Maybe ChannelMessagesFilter -> Maybe ChannelMessagesLimit -> ChannelRequest [Message]
CreateReaction :: (HasID Channel c, HasID Message m) => c -> m -> RawEmoji -> ChannelRequest ()
DeleteOwnReaction :: (HasID Channel c, HasID Message m) => c -> m -> RawEmoji -> ChannelRequest ()
DeleteUserReaction :: (HasID Channel c, HasID Message m, HasID User u) => c -> m -> RawEmoji -> u -> ChannelRequest ()
GetReactions :: (HasID Channel c, HasID Message m) => c -> m -> RawEmoji -> GetReactionsOptions -> ChannelRequest [User]
DeleteAllReactions :: (HasID Channel c, HasID Message m) => c -> m -> ChannelRequest ()
GetChannelInvites :: (HasID Channel c) => c -> ChannelRequest [Invite]
CreateChannelInvite :: (HasID Channel c) => c -> CreateChannelInviteOptions -> ChannelRequest Invite
EditChannelPermissions :: (HasID Channel c) => c -> Overwrite -> ChannelRequest ()
DeleteChannelPermission :: (HasID Channel c, HasID Overwrite o) => c -> o -> ChannelRequest ()
TriggerTyping :: (HasID Channel c) => c -> ChannelRequest ()
GetPinnedMessages :: (HasID Channel c) => c -> ChannelRequest [Message]
AddPinnedMessage :: (HasID Channel c, HasID Message m) => c -> m -> ChannelRequest ()
DeletePinnedMessage :: (HasID Channel c, HasID Message m) => c -> m -> ChannelRequest ()
GroupDMAddRecipient :: (HasID Channel c, HasID User u) => c -> u -> GroupDMAddRecipientOptions -> ChannelRequest ()
GroupDMRemoveRecipient :: (HasID Channel c, HasID User u) => c -> u -> ChannelRequest ()
baseRoute :: Snowflake Channel -> RouteBuilder _
baseRoute :: Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
id =
RouteBuilder '[]
mkRouteBuilder RouteBuilder '[] -> S -> ConsRes S '[]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"channels" RouteBuilder '[] -> ID Channel -> ConsRes (ID Channel) '[]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// ID Channel
forall k (a :: k). ID a
ID @Channel
RouteBuilder '[ '( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder '[ '( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Snowflake Channel
-> RouteBuilder '[ '( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall t (reqs :: [(RequirementType, RouteRequirement)]).
Typeable t =>
Snowflake t
-> RouteBuilder reqs
-> RouteBuilder ('( 'IDRequirement t, 'Satisfied) : reqs)
giveID Snowflake Channel
id
renderEmoji :: RawEmoji -> Text
renderEmoji :: RawEmoji -> Text
renderEmoji (UnicodeEmoji Text
e) = Text
e
renderEmoji (CustomEmoji Partial Emoji
e) = Partial Emoji
e Partial Emoji -> Getting Text (Partial Emoji) Text -> Text
forall s a. s -> Getting a s a -> a
^. IsLabel "name" (Getting Text (Partial Emoji) Text)
Getting Text (Partial Emoji) Text
#name Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
":" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Snowflake Emoji -> Text
forall a. TextShow a => a -> Text
showt (Partial Emoji
e Partial Emoji
-> Getting (Snowflake Emoji) (Partial Emoji) (Snowflake Emoji)
-> Snowflake Emoji
forall s a. s -> Getting a s a -> a
^. IsLabel
"id" (Getting (Snowflake Emoji) (Partial Emoji) (Snowflake Emoji))
Getting (Snowflake Emoji) (Partial Emoji) (Snowflake Emoji)
#id)
instance Request (ChannelRequest a) where
type Result (ChannelRequest a) = a
route :: ChannelRequest a -> Route
route (CreateMessage (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
id) CreateMessageOptions
_) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
id RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"messages"
RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (CrosspostMessage (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
id) (forall a. HasID Message a => a -> Snowflake Message
forall b a. HasID b a => a -> Snowflake b
getID @Message -> Snowflake Message
mid)) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
id RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"messages" RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> ID Message
-> ConsRes
(ID Message)
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// ID Message
forall k (a :: k). ID a
ID @Message
RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Snowflake Message
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall t (reqs :: [(RequirementType, RouteRequirement)]).
Typeable t =>
Snowflake t
-> RouteBuilder reqs
-> RouteBuilder ('( 'IDRequirement t, 'Satisfied) : reqs)
giveID Snowflake Message
mid
RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (GetChannel (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
id)) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
id
RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (ModifyChannel (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
id) ChannelUpdate
_) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
id
RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (DeleteChannel (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
id)) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
id
RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (GetChannelMessages (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
id) Maybe ChannelMessagesFilter
_ Maybe ChannelMessagesLimit
_) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
id RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"messages"
RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (GetMessage (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid) (forall a. HasID Message a => a -> Snowflake Message
forall b a. HasID b a => a -> Snowflake b
getID @Message -> Snowflake Message
mid)) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"messages" RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> ID Message
-> ConsRes
(ID Message)
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// ID Message
forall k (a :: k). ID a
ID @Message
RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Snowflake Message
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall t (reqs :: [(RequirementType, RouteRequirement)]).
Typeable t =>
Snowflake t
-> RouteBuilder reqs
-> RouteBuilder ('( 'IDRequirement t, 'Satisfied) : reqs)
giveID Snowflake Message
mid
RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (CreateReaction (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid) (forall a. HasID Message a => a -> Snowflake Message
forall b a. HasID b a => a -> Snowflake b
getID @Message -> Snowflake Message
mid) RawEmoji
emoji) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"messages" RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> ID Message
-> ConsRes
(ID Message)
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// ID Message
forall k (a :: k). ID a
ID @Message RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"reactions" RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> PS "emoji"
-> ConsRes
(PS "emoji")
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// PS "emoji"
forall (s :: Symbol). PS s
PS @"emoji" RouteBuilder
'[ '( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"@me"
RouteBuilder
'[ '( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Snowflake Message
-> RouteBuilder
'[ '( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall t (reqs :: [(RequirementType, RouteRequirement)]).
Typeable t =>
Snowflake t
-> RouteBuilder reqs
-> RouteBuilder ('( 'IDRequirement t, 'Satisfied) : reqs)
giveID Snowflake Message
mid
RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Text
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall (s :: Symbol)
(reqs :: [(RequirementType, RouteRequirement)]).
KnownSymbol s =>
Text
-> RouteBuilder reqs
-> RouteBuilder ('( 'PSRequirement s, 'Satisfied) : reqs)
giveParam @"emoji" (RawEmoji -> Text
renderEmoji RawEmoji
emoji)
RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (DeleteOwnReaction (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid) (forall a. HasID Message a => a -> Snowflake Message
forall b a. HasID b a => a -> Snowflake b
getID @Message -> Snowflake Message
mid) RawEmoji
emoji) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"messages" RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> ID Message
-> ConsRes
(ID Message)
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// ID Message
forall k (a :: k). ID a
ID @Message RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"reactions" RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> PS "emoji"
-> ConsRes
(PS "emoji")
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// PS "emoji"
forall (s :: Symbol). PS s
PS @"emoji" RouteBuilder
'[ '( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"@me"
RouteBuilder
'[ '( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Snowflake Message
-> RouteBuilder
'[ '( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall t (reqs :: [(RequirementType, RouteRequirement)]).
Typeable t =>
Snowflake t
-> RouteBuilder reqs
-> RouteBuilder ('( 'IDRequirement t, 'Satisfied) : reqs)
giveID Snowflake Message
mid
RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Text
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall (s :: Symbol)
(reqs :: [(RequirementType, RouteRequirement)]).
KnownSymbol s =>
Text
-> RouteBuilder reqs
-> RouteBuilder ('( 'PSRequirement s, 'Satisfied) : reqs)
giveParam @"emoji" (RawEmoji -> Text
renderEmoji RawEmoji
emoji)
RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (DeleteUserReaction (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid) (forall a. HasID Message a => a -> Snowflake Message
forall b a. HasID b a => a -> Snowflake b
getID @Message -> Snowflake Message
mid) RawEmoji
emoji (forall a. HasID User a => a -> Snowflake User
forall b a. HasID b a => a -> Snowflake b
getID @User -> Snowflake User
uid)) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"messages" RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> ID Message
-> ConsRes
(ID Message)
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// ID Message
forall k (a :: k). ID a
ID @Message RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"reactions" RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> PS "emoji"
-> ConsRes
(PS "emoji")
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// PS "emoji"
forall (s :: Symbol). PS s
PS @"emoji" RouteBuilder
'[ '( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> ID User
-> ConsRes
(ID User)
'[ '( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// ID User
forall k (a :: k). ID a
ID @User
RouteBuilder
'[ '( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Snowflake Message
-> RouteBuilder
'[ '( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall t (reqs :: [(RequirementType, RouteRequirement)]).
Typeable t =>
Snowflake t
-> RouteBuilder reqs
-> RouteBuilder ('( 'IDRequirement t, 'Satisfied) : reqs)
giveID Snowflake Message
mid
RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Snowflake User
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall t (reqs :: [(RequirementType, RouteRequirement)]).
Typeable t =>
Snowflake t
-> RouteBuilder reqs
-> RouteBuilder ('( 'IDRequirement t, 'Satisfied) : reqs)
giveID Snowflake User
uid
RouteBuilder
'[ '( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Text
-> RouteBuilder
'[ '( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall (s :: Symbol)
(reqs :: [(RequirementType, RouteRequirement)]).
KnownSymbol s =>
Text
-> RouteBuilder reqs
-> RouteBuilder ('( 'PSRequirement s, 'Satisfied) : reqs)
giveParam @"emoji" (RawEmoji -> Text
renderEmoji RawEmoji
emoji)
RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (GetReactions (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid) (forall a. HasID Message a => a -> Snowflake Message
forall b a. HasID b a => a -> Snowflake b
getID @Message -> Snowflake Message
mid) RawEmoji
emoji GetReactionsOptions
_) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"messages" RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> ID Message
-> ConsRes
(ID Message)
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// ID Message
forall k (a :: k). ID a
ID @Message RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"reactions" RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> PS "emoji"
-> ConsRes
(PS "emoji")
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// PS "emoji"
forall (s :: Symbol). PS s
PS @"emoji"
RouteBuilder
'[ '( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Snowflake Message
-> RouteBuilder
'[ '( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall t (reqs :: [(RequirementType, RouteRequirement)]).
Typeable t =>
Snowflake t
-> RouteBuilder reqs
-> RouteBuilder ('( 'IDRequirement t, 'Satisfied) : reqs)
giveID Snowflake Message
mid
RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Text
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall (s :: Symbol)
(reqs :: [(RequirementType, RouteRequirement)]).
KnownSymbol s =>
Text
-> RouteBuilder reqs
-> RouteBuilder ('( 'PSRequirement s, 'Satisfied) : reqs)
giveParam @"emoji" (RawEmoji -> Text
renderEmoji RawEmoji
emoji)
RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'PSRequirement "emoji", 'Satisfied),
'( 'IDRequirement Message, 'Satisfied),
'( 'PSRequirement "emoji", 'Required),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (DeleteAllReactions (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid) (forall a. HasID Message a => a -> Snowflake Message
forall b a. HasID b a => a -> Snowflake b
getID @Message -> Snowflake Message
mid)) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"messages" RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> ID Message
-> ConsRes
(ID Message)
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// ID Message
forall k (a :: k). ID a
ID @Message RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"reactions"
RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Snowflake Message
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall t (reqs :: [(RequirementType, RouteRequirement)]).
Typeable t =>
Snowflake t
-> RouteBuilder reqs
-> RouteBuilder ('( 'IDRequirement t, 'Satisfied) : reqs)
giveID Snowflake Message
mid
RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (EditMessage (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid) (forall a. HasID Message a => a -> Snowflake Message
forall b a. HasID b a => a -> Snowflake b
getID @Message -> Snowflake Message
mid) EditMessageData
_) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"messages" RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> ID Message
-> ConsRes
(ID Message)
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// ID Message
forall k (a :: k). ID a
ID @Message
RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Snowflake Message
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall t (reqs :: [(RequirementType, RouteRequirement)]).
Typeable t =>
Snowflake t
-> RouteBuilder reqs
-> RouteBuilder ('( 'IDRequirement t, 'Satisfied) : reqs)
giveID Snowflake Message
mid
RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (DeleteMessage (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid) (forall a. HasID Message a => a -> Snowflake Message
forall b a. HasID b a => a -> Snowflake b
getID @Message -> Snowflake Message
mid)) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"messages" RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> ID Message
-> ConsRes
(ID Message)
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// ID Message
forall k (a :: k). ID a
ID @Message
RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Snowflake Message
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall t (reqs :: [(RequirementType, RouteRequirement)]).
Typeable t =>
Snowflake t
-> RouteBuilder reqs
-> RouteBuilder ('( 'IDRequirement t, 'Satisfied) : reqs)
giveID Snowflake Message
mid
RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (BulkDeleteMessages (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid) [m]
_) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"messages" RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"bulk-delete"
RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (GetChannelInvites (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid)) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"invites"
RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (CreateChannelInvite (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid) CreateChannelInviteOptions
_) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"invites"
RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (EditChannelPermissions (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid) (forall a. HasID Overwrite a => a -> Snowflake Overwrite
forall b a. HasID b a => a -> Snowflake b
getID @Overwrite -> Snowflake Overwrite
oid)) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"permissions" RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> ID Overwrite
-> ConsRes
(ID Overwrite)
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// ID Overwrite
forall k (a :: k). ID a
ID @Overwrite
RouteBuilder
'[ '( 'IDRequirement Overwrite, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Overwrite, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Overwrite, 'Satisfied),
'( 'IDRequirement Overwrite, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'IDRequirement Overwrite, 'Satisfied),
'( 'IDRequirement Overwrite, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Snowflake Overwrite
-> RouteBuilder
'[ '( 'IDRequirement Overwrite, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Overwrite, 'Satisfied),
'( 'IDRequirement Overwrite, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall t (reqs :: [(RequirementType, RouteRequirement)]).
Typeable t =>
Snowflake t
-> RouteBuilder reqs
-> RouteBuilder ('( 'IDRequirement t, 'Satisfied) : reqs)
giveID Snowflake Overwrite
oid
RouteBuilder
'[ '( 'IDRequirement Overwrite, 'Satisfied),
'( 'IDRequirement Overwrite, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Overwrite, 'Satisfied),
'( 'IDRequirement Overwrite, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Overwrite, 'Satisfied),
'( 'IDRequirement Overwrite, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (DeleteChannelPermission (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid) (forall a. HasID Overwrite a => a -> Snowflake Overwrite
forall b a. HasID b a => a -> Snowflake b
getID @Overwrite -> Snowflake Overwrite
oid)) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"permissions" RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> ID Overwrite
-> ConsRes
(ID Overwrite)
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// ID Overwrite
forall k (a :: k). ID a
ID @Overwrite
RouteBuilder
'[ '( 'IDRequirement Overwrite, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Overwrite, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Overwrite, 'Satisfied),
'( 'IDRequirement Overwrite, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'IDRequirement Overwrite, 'Satisfied),
'( 'IDRequirement Overwrite, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Snowflake Overwrite
-> RouteBuilder
'[ '( 'IDRequirement Overwrite, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Overwrite, 'Satisfied),
'( 'IDRequirement Overwrite, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall t (reqs :: [(RequirementType, RouteRequirement)]).
Typeable t =>
Snowflake t
-> RouteBuilder reqs
-> RouteBuilder ('( 'IDRequirement t, 'Satisfied) : reqs)
giveID Snowflake Overwrite
oid
RouteBuilder
'[ '( 'IDRequirement Overwrite, 'Satisfied),
'( 'IDRequirement Overwrite, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Overwrite, 'Satisfied),
'( 'IDRequirement Overwrite, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Overwrite, 'Satisfied),
'( 'IDRequirement Overwrite, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (TriggerTyping (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid)) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"typing"
RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (GetPinnedMessages (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid)) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"pins"
RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (AddPinnedMessage (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid) (forall a. HasID Message a => a -> Snowflake Message
forall b a. HasID b a => a -> Snowflake b
getID @Message -> Snowflake Message
mid)) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"pins" RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> ID Message
-> ConsRes
(ID Message)
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// ID Message
forall k (a :: k). ID a
ID @Message
RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Snowflake Message
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall t (reqs :: [(RequirementType, RouteRequirement)]).
Typeable t =>
Snowflake t
-> RouteBuilder reqs
-> RouteBuilder ('( 'IDRequirement t, 'Satisfied) : reqs)
giveID Snowflake Message
mid
RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (DeletePinnedMessage (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid) (forall a. HasID Message a => a -> Snowflake Message
forall b a. HasID b a => a -> Snowflake b
getID @Message -> Snowflake Message
mid)) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"pins" RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> ID Message
-> ConsRes
(ID Message)
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// ID Message
forall k (a :: k). ID a
ID @Message
RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Snowflake Message
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall t (reqs :: [(RequirementType, RouteRequirement)]).
Typeable t =>
Snowflake t
-> RouteBuilder reqs
-> RouteBuilder ('( 'IDRequirement t, 'Satisfied) : reqs)
giveID Snowflake Message
mid
RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement Message, 'Satisfied),
'( 'IDRequirement Message, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (GroupDMAddRecipient (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid) (forall a. HasID User a => a -> Snowflake User
forall b a. HasID b a => a -> Snowflake b
getID @User -> Snowflake User
uid) GroupDMAddRecipientOptions
_) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"recipients" RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> ID User
-> ConsRes
(ID User)
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// ID User
forall k (a :: k). ID a
ID @User
RouteBuilder
'[ '( 'IDRequirement User, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement User, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Snowflake User
-> RouteBuilder
'[ '( 'IDRequirement User, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall t (reqs :: [(RequirementType, RouteRequirement)]).
Typeable t =>
Snowflake t
-> RouteBuilder reqs
-> RouteBuilder ('( 'IDRequirement t, 'Satisfied) : reqs)
giveID Snowflake User
uid
RouteBuilder
'[ '( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
route (GroupDMRemoveRecipient (c -> Snowflake Channel
forall b a. HasID b a => a -> Snowflake b
getID -> Snowflake Channel
cid) (forall a. HasID User a => a -> Snowflake User
forall b a. HasID b a => a -> Snowflake b
getID @User -> Snowflake User
uid)) =
Snowflake Channel
-> RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
baseRoute Snowflake Channel
cid RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> S
-> ConsRes
S
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// Text -> S
S Text
"recipients" RouteBuilder
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> ID User
-> ConsRes
(ID User)
'[ '( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a (reqs :: [(RequirementType, RouteRequirement)]).
RouteFragmentable a reqs =>
RouteBuilder reqs -> a -> ConsRes a reqs
// ID User
forall k (a :: k). ID a
ID @User
RouteBuilder
'[ '( 'IDRequirement User, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement User, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)])
-> RouteBuilder
'[ '( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall a b. a -> (a -> b) -> b
& Snowflake User
-> RouteBuilder
'[ '( 'IDRequirement User, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> RouteBuilder
'[ '( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
forall t (reqs :: [(RequirementType, RouteRequirement)]).
Typeable t =>
Snowflake t
-> RouteBuilder reqs
-> RouteBuilder ('( 'IDRequirement t, 'Satisfied) : reqs)
giveID Snowflake User
uid
RouteBuilder
'[ '( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> (RouteBuilder
'[ '( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route)
-> Route
forall a b. a -> (a -> b) -> b
& RouteBuilder
'[ '( 'IDRequirement User, 'Satisfied),
'( 'IDRequirement User, 'Required),
'( 'IDRequirement Channel, 'Satisfied),
'( 'IDRequirement Channel, 'Required)]
-> Route
forall (reqs :: [(RequirementType, RouteRequirement)]).
EnsureFulfilled reqs =>
RouteBuilder reqs -> Route
buildRoute
action :: ChannelRequest a -> Url 'Https -> Option 'Https -> Req LbsResponse
action (CreateMessage c
_ CreateMessageOptions
cm) = \Url 'Https
u Option 'Https
o -> do
let filePart :: CreateMessageAttachment -> i -> PartM IO
filePart CreateMessageAttachment {Text
filename :: Text
$sel:filename:CreateMessageAttachment :: CreateMessageAttachment -> Text
filename, ByteString
content :: ByteString
$sel:content:CreateMessageAttachment :: CreateMessageAttachment -> ByteString
content} i
n =
(Text -> ByteString -> PartM IO
forall (m :: * -> *).
Applicative m =>
Text -> ByteString -> PartM m
partLBS @IO [fmt|files[{n}]|] ByteString
content)
{ partFilename :: Maybe String
partFilename = String -> Maybe String
forall a. a -> Maybe a
Just (Text -> String
T.unpack Text
filename)
, partContentType :: Maybe MimeType
partContentType = MimeType -> Maybe MimeType
forall a. a -> Maybe a
Just (Text -> MimeType
defaultMimeLookup Text
filename)
}
attachmentPart :: CreateMessageAttachment -> Int -> CreateMessageAttachmentJson
attachmentPart CreateMessageAttachment {Text
filename :: Text
$sel:filename:CreateMessageAttachment :: CreateMessageAttachment -> Text
filename, Maybe Text
description :: Maybe Text
$sel:description:CreateMessageAttachment :: CreateMessageAttachment -> Maybe Text
description} Int
n =
Int -> Text -> Maybe Text -> CreateMessageAttachmentJson
CreateMessageAttachmentJson Int
n Text
filename Maybe Text
description
files :: [PartM IO]
files = (CreateMessageAttachment -> Int -> PartM IO)
-> [CreateMessageAttachment] -> [Int] -> [PartM IO]
forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith CreateMessageAttachment -> Int -> PartM IO
forall i.
FormatAny2 (PyFClassify i) i 'AlignAll =>
CreateMessageAttachment -> i -> PartM IO
filePart ([CreateMessageAttachment]
-> Maybe [CreateMessageAttachment] -> [CreateMessageAttachment]
forall a. a -> Maybe a -> a
fromMaybe [] (Maybe [CreateMessageAttachment] -> [CreateMessageAttachment])
-> Maybe [CreateMessageAttachment] -> [CreateMessageAttachment]
forall a b. (a -> b) -> a -> b
$ CreateMessageOptions
cm CreateMessageOptions
-> Getting
(Maybe [CreateMessageAttachment])
CreateMessageOptions
(Maybe [CreateMessageAttachment])
-> Maybe [CreateMessageAttachment]
forall s a. s -> Getting a s a -> a
^. IsLabel
"attachments"
(Getting
(Maybe [CreateMessageAttachment])
CreateMessageOptions
(Maybe [CreateMessageAttachment]))
Getting
(Maybe [CreateMessageAttachment])
CreateMessageOptions
(Maybe [CreateMessageAttachment])
#attachments) [(Int
0 :: Int) ..]
attachments :: Maybe [CreateMessageAttachmentJson]
attachments = (\[CreateMessageAttachment]
a -> (CreateMessageAttachment -> Int -> CreateMessageAttachmentJson)
-> [CreateMessageAttachment]
-> [Int]
-> [CreateMessageAttachmentJson]
forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith CreateMessageAttachment -> Int -> CreateMessageAttachmentJson
attachmentPart [CreateMessageAttachment]
a [Int
0 ..]) ([CreateMessageAttachment] -> [CreateMessageAttachmentJson])
-> Maybe [CreateMessageAttachment]
-> Maybe [CreateMessageAttachmentJson]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> CreateMessageOptions
cm CreateMessageOptions
-> Getting
(Maybe [CreateMessageAttachment])
CreateMessageOptions
(Maybe [CreateMessageAttachment])
-> Maybe [CreateMessageAttachment]
forall s a. s -> Getting a s a -> a
^. IsLabel
"attachments"
(Getting
(Maybe [CreateMessageAttachment])
CreateMessageOptions
(Maybe [CreateMessageAttachment]))
Getting
(Maybe [CreateMessageAttachment])
CreateMessageOptions
(Maybe [CreateMessageAttachment])
#attachments
jsonBody :: CreateMessageJson
jsonBody =
CreateMessageJson :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe [Embed]
-> Maybe AllowedMentions
-> Maybe MessageReference
-> Maybe [Component]
-> Maybe [CreateMessageAttachmentJson]
-> CreateMessageJson
CreateMessageJson
{ $sel:content:CreateMessageJson :: Maybe Text
content = CreateMessageOptions
cm CreateMessageOptions
-> Getting (Maybe Text) CreateMessageOptions (Maybe Text)
-> Maybe Text
forall s a. s -> Getting a s a -> a
^. IsLabel
"content" (Getting (Maybe Text) CreateMessageOptions (Maybe Text))
Getting (Maybe Text) CreateMessageOptions (Maybe Text)
#content
, $sel:nonce:CreateMessageJson :: Maybe Text
nonce = CreateMessageOptions
cm CreateMessageOptions
-> Getting (Maybe Text) CreateMessageOptions (Maybe Text)
-> Maybe Text
forall s a. s -> Getting a s a -> a
^. IsLabel
"nonce" (Getting (Maybe Text) CreateMessageOptions (Maybe Text))
Getting (Maybe Text) CreateMessageOptions (Maybe Text)
#nonce
, $sel:tts:CreateMessageJson :: Maybe Bool
tts = CreateMessageOptions
cm CreateMessageOptions
-> Getting (Maybe Bool) CreateMessageOptions (Maybe Bool)
-> Maybe Bool
forall s a. s -> Getting a s a -> a
^. IsLabel
"tts" (Getting (Maybe Bool) CreateMessageOptions (Maybe Bool))
Getting (Maybe Bool) CreateMessageOptions (Maybe Bool)
#tts
, $sel:embeds:CreateMessageJson :: Maybe [Embed]
embeds = CreateMessageOptions
cm CreateMessageOptions
-> Getting (Maybe [Embed]) CreateMessageOptions (Maybe [Embed])
-> Maybe [Embed]
forall s a. s -> Getting a s a -> a
^. IsLabel
"embeds"
(Getting (Maybe [Embed]) CreateMessageOptions (Maybe [Embed]))
Getting (Maybe [Embed]) CreateMessageOptions (Maybe [Embed])
#embeds
, $sel:allowedMentions:CreateMessageJson :: Maybe AllowedMentions
allowedMentions = CreateMessageOptions
cm CreateMessageOptions
-> Getting
(Maybe AllowedMentions)
CreateMessageOptions
(Maybe AllowedMentions)
-> Maybe AllowedMentions
forall s a. s -> Getting a s a -> a
^. IsLabel
"allowedMentions"
(Getting
(Maybe AllowedMentions)
CreateMessageOptions
(Maybe AllowedMentions))
Getting
(Maybe AllowedMentions)
CreateMessageOptions
(Maybe AllowedMentions)
#allowedMentions
, $sel:messageReference:CreateMessageJson :: Maybe MessageReference
messageReference = CreateMessageOptions
cm CreateMessageOptions
-> Getting
(Maybe MessageReference)
CreateMessageOptions
(Maybe MessageReference)
-> Maybe MessageReference
forall s a. s -> Getting a s a -> a
^. IsLabel
"messageReference"
(Getting
(Maybe MessageReference)
CreateMessageOptions
(Maybe MessageReference))
Getting
(Maybe MessageReference)
CreateMessageOptions
(Maybe MessageReference)
#messageReference
, $sel:components:CreateMessageJson :: Maybe [Component]
components = CreateMessageOptions
cm CreateMessageOptions
-> Getting
(Maybe [Component]) CreateMessageOptions (Maybe [Component])
-> Maybe [Component]
forall s a. s -> Getting a s a -> a
^. IsLabel
"components"
(Getting
(Maybe [Component]) CreateMessageOptions (Maybe [Component]))
Getting
(Maybe [Component]) CreateMessageOptions (Maybe [Component])
#components
, $sel:attachments:CreateMessageJson :: Maybe [CreateMessageAttachmentJson]
attachments = Maybe [CreateMessageAttachmentJson]
attachments
}
ReqBodyMultipart
body <- [PartM IO] -> Req ReqBodyMultipart
forall (m :: * -> *). MonadIO m => [PartM IO] -> m ReqBodyMultipart
reqBodyMultipart (Text -> ByteString -> PartM IO
forall (m :: * -> *).
Applicative m =>
Text -> ByteString -> PartM m
partLBS Text
"payload_json" (CreateMessageJson -> ByteString
forall a. ToJSON a => a -> ByteString
encode CreateMessageJson
jsonBody) PartM IO -> [PartM IO] -> [PartM IO]
forall a. a -> [a] -> [a]
: [PartM IO]
files)
ReqBodyMultipart -> Url 'Https -> Option 'Https -> Req LbsResponse
forall a.
HttpBody a =>
a -> Url 'Https -> Option 'Https -> Req LbsResponse
postWith' ReqBodyMultipart
body Url 'Https
u Option 'Https
o
action (CrosspostMessage c
_ m
_) = Url 'Https -> Option 'Https -> Req LbsResponse
postEmpty
action (GetChannel c
_) = Url 'Https -> Option 'Https -> Req LbsResponse
getWith
action (ModifyChannel c
_ ChannelUpdate
p) = ReqBodyJson ChannelUpdate
-> Url 'Https -> Option 'Https -> Req LbsResponse
forall a.
HttpBody a =>
a -> Url 'Https -> Option 'Https -> Req LbsResponse
patchWith' (ChannelUpdate -> ReqBodyJson ChannelUpdate
forall a. a -> ReqBodyJson a
ReqBodyJson ChannelUpdate
p)
action (DeleteChannel c
_) = Url 'Https -> Option 'Https -> Req LbsResponse
deleteWith
action (GetChannelMessages c
_ (Just (ChannelMessagesAround (Snowflake Message -> Word64
forall t. Snowflake t -> Word64
fromSnowflake -> Word64
a))) Maybe ChannelMessagesLimit
l) =
Option 'Https -> Url 'Https -> Option 'Https -> Req LbsResponse
getWithP (Text
"around" Text -> Word64 -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
=: Word64
a Option 'Https -> Option 'Https -> Option 'Https
forall a. Semigroup a => a -> a -> a
<> Text
"limit" Text -> Maybe Integer -> Option 'Https
forall a. ToHttpApiData a => Text -> Maybe a -> Option 'Https
=:? (Maybe ChannelMessagesLimit
l Maybe ChannelMessagesLimit
-> Getting (First Integer) (Maybe ChannelMessagesLimit) Integer
-> Maybe Integer
forall s a. s -> Getting (First a) s a -> Maybe a
^? (ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit)
-> Maybe ChannelMessagesLimit
-> Const (First Integer) (Maybe ChannelMessagesLimit)
forall a b. Prism (Maybe a) (Maybe b) a b
_Just ((ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit)
-> Maybe ChannelMessagesLimit
-> Const (First Integer) (Maybe ChannelMessagesLimit))
-> ((Integer -> Const (First Integer) Integer)
-> ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit)
-> Getting (First Integer) (Maybe ChannelMessagesLimit) Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IsLabel
"limit"
((Integer -> Const (First Integer) Integer)
-> ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit)
(Integer -> Const (First Integer) Integer)
-> ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit
#limit))
action (GetChannelMessages c
_ (Just (ChannelMessagesBefore (Snowflake Message -> Word64
forall t. Snowflake t -> Word64
fromSnowflake -> Word64
a))) Maybe ChannelMessagesLimit
l) =
Option 'Https -> Url 'Https -> Option 'Https -> Req LbsResponse
getWithP (Text
"before" Text -> Word64 -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
=: Word64
a Option 'Https -> Option 'Https -> Option 'Https
forall a. Semigroup a => a -> a -> a
<> Text
"limit" Text -> Maybe Integer -> Option 'Https
forall a. ToHttpApiData a => Text -> Maybe a -> Option 'Https
=:? (Maybe ChannelMessagesLimit
l Maybe ChannelMessagesLimit
-> Getting (First Integer) (Maybe ChannelMessagesLimit) Integer
-> Maybe Integer
forall s a. s -> Getting (First a) s a -> Maybe a
^? (ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit)
-> Maybe ChannelMessagesLimit
-> Const (First Integer) (Maybe ChannelMessagesLimit)
forall a b. Prism (Maybe a) (Maybe b) a b
_Just ((ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit)
-> Maybe ChannelMessagesLimit
-> Const (First Integer) (Maybe ChannelMessagesLimit))
-> ((Integer -> Const (First Integer) Integer)
-> ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit)
-> Getting (First Integer) (Maybe ChannelMessagesLimit) Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IsLabel
"limit"
((Integer -> Const (First Integer) Integer)
-> ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit)
(Integer -> Const (First Integer) Integer)
-> ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit
#limit))
action (GetChannelMessages c
_ (Just (ChannelMessagesAfter (Snowflake Message -> Word64
forall t. Snowflake t -> Word64
fromSnowflake -> Word64
a))) Maybe ChannelMessagesLimit
l) =
Option 'Https -> Url 'Https -> Option 'Https -> Req LbsResponse
getWithP (Text
"after" Text -> Word64 -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
=: Word64
a Option 'Https -> Option 'Https -> Option 'Https
forall a. Semigroup a => a -> a -> a
<> Text
"limit" Text -> Maybe Integer -> Option 'Https
forall a. ToHttpApiData a => Text -> Maybe a -> Option 'Https
=:? (Maybe ChannelMessagesLimit
l Maybe ChannelMessagesLimit
-> Getting (First Integer) (Maybe ChannelMessagesLimit) Integer
-> Maybe Integer
forall s a. s -> Getting (First a) s a -> Maybe a
^? (ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit)
-> Maybe ChannelMessagesLimit
-> Const (First Integer) (Maybe ChannelMessagesLimit)
forall a b. Prism (Maybe a) (Maybe b) a b
_Just ((ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit)
-> Maybe ChannelMessagesLimit
-> Const (First Integer) (Maybe ChannelMessagesLimit))
-> ((Integer -> Const (First Integer) Integer)
-> ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit)
-> Getting (First Integer) (Maybe ChannelMessagesLimit) Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IsLabel
"limit"
((Integer -> Const (First Integer) Integer)
-> ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit)
(Integer -> Const (First Integer) Integer)
-> ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit
#limit))
action (GetChannelMessages c
_ Maybe ChannelMessagesFilter
Nothing Maybe ChannelMessagesLimit
l) = Option 'Https -> Url 'Https -> Option 'Https -> Req LbsResponse
getWithP (Text
"limit" Text -> Maybe Integer -> Option 'Https
forall a. ToHttpApiData a => Text -> Maybe a -> Option 'Https
=:? (Maybe ChannelMessagesLimit
l Maybe ChannelMessagesLimit
-> Getting (First Integer) (Maybe ChannelMessagesLimit) Integer
-> Maybe Integer
forall s a. s -> Getting (First a) s a -> Maybe a
^? (ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit)
-> Maybe ChannelMessagesLimit
-> Const (First Integer) (Maybe ChannelMessagesLimit)
forall a b. Prism (Maybe a) (Maybe b) a b
_Just ((ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit)
-> Maybe ChannelMessagesLimit
-> Const (First Integer) (Maybe ChannelMessagesLimit))
-> ((Integer -> Const (First Integer) Integer)
-> ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit)
-> Getting (First Integer) (Maybe ChannelMessagesLimit) Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IsLabel
"limit"
((Integer -> Const (First Integer) Integer)
-> ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit)
(Integer -> Const (First Integer) Integer)
-> ChannelMessagesLimit
-> Const (First Integer) ChannelMessagesLimit
#limit))
action (GetMessage c
_ m
_) = Url 'Https -> Option 'Https -> Req LbsResponse
getWith
action CreateReaction {} = Url 'Https -> Option 'Https -> Req LbsResponse
putEmpty
action DeleteOwnReaction {} = Url 'Https -> Option 'Https -> Req LbsResponse
deleteWith
action DeleteUserReaction {} = Url 'Https -> Option 'Https -> Req LbsResponse
deleteWith
action (GetReactions c
_ m
_ RawEmoji
_ GetReactionsOptions {Maybe (Snowflake User)
before :: Maybe (Snowflake User)
$sel:before:GetReactionsOptions :: GetReactionsOptions -> Maybe (Snowflake User)
before, Maybe (Snowflake User)
after :: Maybe (Snowflake User)
$sel:after:GetReactionsOptions :: GetReactionsOptions -> Maybe (Snowflake User)
after, Maybe Integer
limit :: Maybe Integer
$sel:limit:GetReactionsOptions :: GetReactionsOptions -> Maybe Integer
limit}) =
Option 'Https -> Url 'Https -> Option 'Https -> Req LbsResponse
getWithP
( Text
"before" Text -> Maybe Word64 -> Option 'Https
forall a. ToHttpApiData a => Text -> Maybe a -> Option 'Https
=:? (Snowflake User -> Word64
forall t. Snowflake t -> Word64
fromSnowflake (Snowflake User -> Word64)
-> Maybe (Snowflake User) -> Maybe Word64
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (Snowflake User)
before)
Option 'Https -> Option 'Https -> Option 'Https
forall a. Semigroup a => a -> a -> a
<> Text
"after" Text -> Maybe Word64 -> Option 'Https
forall a. ToHttpApiData a => Text -> Maybe a -> Option 'Https
=:? (Snowflake User -> Word64
forall t. Snowflake t -> Word64
fromSnowflake (Snowflake User -> Word64)
-> Maybe (Snowflake User) -> Maybe Word64
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (Snowflake User)
after)
Option 'Https -> Option 'Https -> Option 'Https
forall a. Semigroup a => a -> a -> a
<> Text
"limit" Text -> Maybe Integer -> Option 'Https
forall a. ToHttpApiData a => Text -> Maybe a -> Option 'Https
=:? Maybe Integer
limit
)
action (DeleteAllReactions c
_ m
_) = Url 'Https -> Option 'Https -> Req LbsResponse
deleteWith
action (EditMessage c
_ m
_ EditMessageData
o) = ReqBodyJson EditMessageData
-> Url 'Https -> Option 'Https -> Req LbsResponse
forall a.
HttpBody a =>
a -> Url 'Https -> Option 'Https -> Req LbsResponse
patchWith' (EditMessageData -> ReqBodyJson EditMessageData
forall a. a -> ReqBodyJson a
ReqBodyJson EditMessageData
o)
action (DeleteMessage c
_ m
_) = Url 'Https -> Option 'Https -> Req LbsResponse
deleteWith
action (BulkDeleteMessages c
_ ((m -> Snowflake Message) -> [m] -> [Snowflake Message]
forall a b. (a -> b) -> [a] -> [b]
map (forall a. HasID Message a => a -> Snowflake Message
forall b a. HasID b a => a -> Snowflake b
getID @Message) -> [Snowflake Message]
ids)) = ReqBodyJson Value -> Url 'Https -> Option 'Https -> Req LbsResponse
forall a.
HttpBody a =>
a -> Url 'Https -> Option 'Https -> Req LbsResponse
postWith' (Value -> ReqBodyJson Value
forall a. a -> ReqBodyJson a
ReqBodyJson (Value -> ReqBodyJson Value) -> Value -> ReqBodyJson Value
forall a b. (a -> b) -> a -> b
$ [(Key, Value)] -> Value
object [Key
"messages" Key -> [Snowflake Message] -> (Key, Value)
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= [Snowflake Message]
ids])
action (GetChannelInvites c
_) = Url 'Https -> Option 'Https -> Req LbsResponse
getWith
action (CreateChannelInvite c
_ CreateChannelInviteOptions
o) = ReqBodyJson CreateChannelInviteOptions
-> Url 'Https -> Option 'Https -> Req LbsResponse
forall a.
HttpBody a =>
a -> Url 'Https -> Option 'Https -> Req LbsResponse
postWith' (CreateChannelInviteOptions
-> ReqBodyJson CreateChannelInviteOptions
forall a. a -> ReqBodyJson a
ReqBodyJson CreateChannelInviteOptions
o)
action (EditChannelPermissions c
_ Overwrite
o) = ReqBodyJson Overwrite
-> Url 'Https -> Option 'Https -> Req LbsResponse
forall a.
HttpBody a =>
a -> Url 'Https -> Option 'Https -> Req LbsResponse
putWith' (Overwrite -> ReqBodyJson Overwrite
forall a. a -> ReqBodyJson a
ReqBodyJson Overwrite
o)
action (DeleteChannelPermission c
_ o
_) = Url 'Https -> Option 'Https -> Req LbsResponse
deleteWith
action (TriggerTyping c
_) = Url 'Https -> Option 'Https -> Req LbsResponse
postEmpty
action (GetPinnedMessages c
_) = Url 'Https -> Option 'Https -> Req LbsResponse
getWith
action (AddPinnedMessage c
_ m
_) = Url 'Https -> Option 'Https -> Req LbsResponse
putEmpty
action (DeletePinnedMessage c
_ m
_) = Url 'Https -> Option 'Https -> Req LbsResponse
deleteWith
action (GroupDMAddRecipient c
_ u
_ GroupDMAddRecipientOptions
o) = ReqBodyJson GroupDMAddRecipientOptions
-> Url 'Https -> Option 'Https -> Req LbsResponse
forall a.
HttpBody a =>
a -> Url 'Https -> Option 'Https -> Req LbsResponse
putWith' (GroupDMAddRecipientOptions
-> ReqBodyJson GroupDMAddRecipientOptions
forall a. a -> ReqBodyJson a
ReqBodyJson GroupDMAddRecipientOptions
o)
action (GroupDMRemoveRecipient c
_ u
_) = Url 'Https -> Option 'Https -> Req LbsResponse
deleteWith