module Calamity.Gateway.DispatchEvents where
import Calamity.Internal.AesonThings
import Calamity.Internal.ConstructorName
import Calamity.Internal.UnixTimestamp
import Calamity.Internal.Utils
import Calamity.Types.Model.Channel
import Calamity.Types.Model.Channel.UpdatedMessage
import Calamity.Types.Model.Guild.Ban
import Calamity.Types.Model.Guild.Emoji
import Calamity.Types.Model.Guild.Guild
import Calamity.Types.Model.Guild.Member
import Calamity.Types.Model.Guild.Role
import Calamity.Types.Model.Guild.UnavailableGuild
import Calamity.Types.Model.Interaction
import Calamity.Types.Model.Presence.Presence
import Calamity.Types.Model.User
import Calamity.Types.Model.Voice
import Calamity.Types.Snowflake
import Data.Aeson
import Data.Kind (Type)
import Data.Text (Text)
import Data.Time
import Data.Typeable (Typeable)
import GHC.Generics
data CalamityEvent
= Dispatch
Int
DispatchData
|
forall (a :: Type). Typeable a => Custom a
| ShutDown
data DispatchData
= Ready !ReadyData
| Resumed
| ChannelCreate !Channel
| ChannelUpdate !Channel
| ChannelDelete !Channel
| ChannelPinsUpdate !ChannelPinsUpdateData
| GuildCreate !Guild
| GuildUpdate !UpdatedGuild
| GuildDelete !UnavailableGuild
| GuildBanAdd !BanData
| GuildBanRemove !BanData
| GuildEmojisUpdate !GuildEmojisUpdateData
| GuildIntegrationsUpdate !GuildIntegrationsUpdateData
| GuildMemberAdd !(Snowflake Guild) !Member
| GuildMemberRemove !GuildMemberRemoveData
| GuildMemberUpdate !GuildMemberUpdateData
| GuildMembersChunk !GuildMembersChunkData
| GuildRoleCreate !GuildRoleData
| GuildRoleUpdate !GuildRoleData
| GuildRoleDelete !GuildRoleDeleteData
| InviteCreate !InviteCreateData
| InviteDelete !InviteDeleteData
| MessageCreate !Message !(Maybe User) !(Maybe Member)
| MessageUpdate !UpdatedMessage !(Maybe User) !(Maybe Member)
| MessageDelete !MessageDeleteData
| MessageDeleteBulk !MessageDeleteBulkData
| MessageReactionAdd !ReactionEvtData
| MessageReactionRemove !ReactionEvtData
| MessageReactionRemoveAll !MessageReactionRemoveAllData
| PresenceUpdate !PresenceUpdateData
| TypingStart !TypingStartData
| UserUpdate !User
| VoiceStateUpdate !VoiceState
| VoiceServerUpdate !VoiceServerUpdateData
| WebhooksUpdate !WebhooksUpdateData
| InteractionCreate !Interaction
deriving (Int -> DispatchData -> ShowS
[DispatchData] -> ShowS
DispatchData -> String
(Int -> DispatchData -> ShowS)
-> (DispatchData -> String)
-> ([DispatchData] -> ShowS)
-> Show DispatchData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DispatchData] -> ShowS
$cshowList :: [DispatchData] -> ShowS
show :: DispatchData -> String
$cshow :: DispatchData -> String
showsPrec :: Int -> DispatchData -> ShowS
$cshowsPrec :: Int -> DispatchData -> ShowS
Show, (forall x. DispatchData -> Rep DispatchData x)
-> (forall x. Rep DispatchData x -> DispatchData)
-> Generic DispatchData
forall x. Rep DispatchData x -> DispatchData
forall x. DispatchData -> Rep DispatchData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DispatchData x -> DispatchData
$cfrom :: forall x. DispatchData -> Rep DispatchData x
Generic, DispatchData -> String
(DispatchData -> String) -> CtorName DispatchData
forall a. (a -> String) -> CtorName a
ctorName :: DispatchData -> String
$cctorName :: DispatchData -> String
CtorName)
data ReadyData = ReadyData
{ ReadyData -> Integer
v :: Integer
, ReadyData -> User
user :: User
, ReadyData -> [UnavailableGuild]
guilds :: [UnavailableGuild]
, ReadyData -> Text
sessionID :: Text
}
deriving (Int -> ReadyData -> ShowS
[ReadyData] -> ShowS
ReadyData -> String
(Int -> ReadyData -> ShowS)
-> (ReadyData -> String)
-> ([ReadyData] -> ShowS)
-> Show ReadyData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReadyData] -> ShowS
$cshowList :: [ReadyData] -> ShowS
show :: ReadyData -> String
$cshow :: ReadyData -> String
showsPrec :: Int -> ReadyData -> ShowS
$cshowsPrec :: Int -> ReadyData -> ShowS
Show, (forall x. ReadyData -> Rep ReadyData x)
-> (forall x. Rep ReadyData x -> ReadyData) -> Generic ReadyData
forall x. Rep ReadyData x -> ReadyData
forall x. ReadyData -> Rep ReadyData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReadyData x -> ReadyData
$cfrom :: forall x. ReadyData -> Rep ReadyData x
Generic)
deriving (Value -> Parser [ReadyData]
Value -> Parser ReadyData
(Value -> Parser ReadyData)
-> (Value -> Parser [ReadyData]) -> FromJSON ReadyData
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [ReadyData]
$cparseJSONList :: Value -> Parser [ReadyData]
parseJSON :: Value -> Parser ReadyData
$cparseJSON :: Value -> Parser ReadyData
FromJSON) via CalamityJSON ReadyData
data ChannelPinsUpdateData = ChannelPinsUpdateData
{ ChannelPinsUpdateData -> Snowflake Channel
channelID :: Snowflake Channel
, ChannelPinsUpdateData -> Maybe UTCTime
lastPinTimestamp :: Maybe UTCTime
}
deriving (Int -> ChannelPinsUpdateData -> ShowS
[ChannelPinsUpdateData] -> ShowS
ChannelPinsUpdateData -> String
(Int -> ChannelPinsUpdateData -> ShowS)
-> (ChannelPinsUpdateData -> String)
-> ([ChannelPinsUpdateData] -> ShowS)
-> Show ChannelPinsUpdateData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelPinsUpdateData] -> ShowS
$cshowList :: [ChannelPinsUpdateData] -> ShowS
show :: ChannelPinsUpdateData -> String
$cshow :: ChannelPinsUpdateData -> String
showsPrec :: Int -> ChannelPinsUpdateData -> ShowS
$cshowsPrec :: Int -> ChannelPinsUpdateData -> ShowS
Show, (forall x. ChannelPinsUpdateData -> Rep ChannelPinsUpdateData x)
-> (forall x. Rep ChannelPinsUpdateData x -> ChannelPinsUpdateData)
-> Generic ChannelPinsUpdateData
forall x. Rep ChannelPinsUpdateData x -> ChannelPinsUpdateData
forall x. ChannelPinsUpdateData -> Rep ChannelPinsUpdateData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChannelPinsUpdateData x -> ChannelPinsUpdateData
$cfrom :: forall x. ChannelPinsUpdateData -> Rep ChannelPinsUpdateData x
Generic)
deriving (Value -> Parser [ChannelPinsUpdateData]
Value -> Parser ChannelPinsUpdateData
(Value -> Parser ChannelPinsUpdateData)
-> (Value -> Parser [ChannelPinsUpdateData])
-> FromJSON ChannelPinsUpdateData
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [ChannelPinsUpdateData]
$cparseJSONList :: Value -> Parser [ChannelPinsUpdateData]
parseJSON :: Value -> Parser ChannelPinsUpdateData
$cparseJSON :: Value -> Parser ChannelPinsUpdateData
FromJSON) via CalamityJSON ChannelPinsUpdateData
data GuildEmojisUpdateData = GuildEmojisUpdateData
{ GuildEmojisUpdateData -> Snowflake Guild
guildID :: Snowflake Guild
, GuildEmojisUpdateData -> [Emoji]
emojis :: [Emoji]
}
deriving (Int -> GuildEmojisUpdateData -> ShowS
[GuildEmojisUpdateData] -> ShowS
GuildEmojisUpdateData -> String
(Int -> GuildEmojisUpdateData -> ShowS)
-> (GuildEmojisUpdateData -> String)
-> ([GuildEmojisUpdateData] -> ShowS)
-> Show GuildEmojisUpdateData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GuildEmojisUpdateData] -> ShowS
$cshowList :: [GuildEmojisUpdateData] -> ShowS
show :: GuildEmojisUpdateData -> String
$cshow :: GuildEmojisUpdateData -> String
showsPrec :: Int -> GuildEmojisUpdateData -> ShowS
$cshowsPrec :: Int -> GuildEmojisUpdateData -> ShowS
Show, (forall x. GuildEmojisUpdateData -> Rep GuildEmojisUpdateData x)
-> (forall x. Rep GuildEmojisUpdateData x -> GuildEmojisUpdateData)
-> Generic GuildEmojisUpdateData
forall x. Rep GuildEmojisUpdateData x -> GuildEmojisUpdateData
forall x. GuildEmojisUpdateData -> Rep GuildEmojisUpdateData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GuildEmojisUpdateData x -> GuildEmojisUpdateData
$cfrom :: forall x. GuildEmojisUpdateData -> Rep GuildEmojisUpdateData x
Generic)
deriving (Value -> Parser [GuildEmojisUpdateData]
Value -> Parser GuildEmojisUpdateData
(Value -> Parser GuildEmojisUpdateData)
-> (Value -> Parser [GuildEmojisUpdateData])
-> FromJSON GuildEmojisUpdateData
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [GuildEmojisUpdateData]
$cparseJSONList :: Value -> Parser [GuildEmojisUpdateData]
parseJSON :: Value -> Parser GuildEmojisUpdateData
$cparseJSON :: Value -> Parser GuildEmojisUpdateData
FromJSON) via CalamityJSON GuildEmojisUpdateData
newtype GuildIntegrationsUpdateData = GuildIntegrationsUpdateData
{ GuildIntegrationsUpdateData -> Snowflake Guild
guildID :: Snowflake Guild
}
deriving newtype (Int -> GuildIntegrationsUpdateData -> ShowS
[GuildIntegrationsUpdateData] -> ShowS
GuildIntegrationsUpdateData -> String
(Int -> GuildIntegrationsUpdateData -> ShowS)
-> (GuildIntegrationsUpdateData -> String)
-> ([GuildIntegrationsUpdateData] -> ShowS)
-> Show GuildIntegrationsUpdateData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GuildIntegrationsUpdateData] -> ShowS
$cshowList :: [GuildIntegrationsUpdateData] -> ShowS
show :: GuildIntegrationsUpdateData -> String
$cshow :: GuildIntegrationsUpdateData -> String
showsPrec :: Int -> GuildIntegrationsUpdateData -> ShowS
$cshowsPrec :: Int -> GuildIntegrationsUpdateData -> ShowS
Show, Rep GuildIntegrationsUpdateData x -> GuildIntegrationsUpdateData
GuildIntegrationsUpdateData -> Rep GuildIntegrationsUpdateData x
(forall x.
GuildIntegrationsUpdateData -> Rep GuildIntegrationsUpdateData x)
-> (forall x.
Rep GuildIntegrationsUpdateData x -> GuildIntegrationsUpdateData)
-> Generic GuildIntegrationsUpdateData
forall x.
Rep GuildIntegrationsUpdateData x -> GuildIntegrationsUpdateData
forall x.
GuildIntegrationsUpdateData -> Rep GuildIntegrationsUpdateData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
to :: Rep GuildIntegrationsUpdateData x -> GuildIntegrationsUpdateData
$cto :: forall x.
Rep GuildIntegrationsUpdateData x -> GuildIntegrationsUpdateData
from :: GuildIntegrationsUpdateData -> Rep GuildIntegrationsUpdateData x
$cfrom :: forall x.
GuildIntegrationsUpdateData -> Rep GuildIntegrationsUpdateData x
Generic)
deriving (Value -> Parser [GuildIntegrationsUpdateData]
Value -> Parser GuildIntegrationsUpdateData
(Value -> Parser GuildIntegrationsUpdateData)
-> (Value -> Parser [GuildIntegrationsUpdateData])
-> FromJSON GuildIntegrationsUpdateData
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [GuildIntegrationsUpdateData]
$cparseJSONList :: Value -> Parser [GuildIntegrationsUpdateData]
parseJSON :: Value -> Parser GuildIntegrationsUpdateData
$cparseJSON :: Value -> Parser GuildIntegrationsUpdateData
FromJSON) via CalamityJSON GuildIntegrationsUpdateData
data GuildMemberRemoveData = GuildMemberRemoveData
{ GuildMemberRemoveData -> Snowflake Guild
guildID :: Snowflake Guild
, GuildMemberRemoveData -> User
user :: User
}
deriving (Int -> GuildMemberRemoveData -> ShowS
[GuildMemberRemoveData] -> ShowS
GuildMemberRemoveData -> String
(Int -> GuildMemberRemoveData -> ShowS)
-> (GuildMemberRemoveData -> String)
-> ([GuildMemberRemoveData] -> ShowS)
-> Show GuildMemberRemoveData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GuildMemberRemoveData] -> ShowS
$cshowList :: [GuildMemberRemoveData] -> ShowS
show :: GuildMemberRemoveData -> String
$cshow :: GuildMemberRemoveData -> String
showsPrec :: Int -> GuildMemberRemoveData -> ShowS
$cshowsPrec :: Int -> GuildMemberRemoveData -> ShowS
Show, (forall x. GuildMemberRemoveData -> Rep GuildMemberRemoveData x)
-> (forall x. Rep GuildMemberRemoveData x -> GuildMemberRemoveData)
-> Generic GuildMemberRemoveData
forall x. Rep GuildMemberRemoveData x -> GuildMemberRemoveData
forall x. GuildMemberRemoveData -> Rep GuildMemberRemoveData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GuildMemberRemoveData x -> GuildMemberRemoveData
$cfrom :: forall x. GuildMemberRemoveData -> Rep GuildMemberRemoveData x
Generic)
deriving (Value -> Parser [GuildMemberRemoveData]
Value -> Parser GuildMemberRemoveData
(Value -> Parser GuildMemberRemoveData)
-> (Value -> Parser [GuildMemberRemoveData])
-> FromJSON GuildMemberRemoveData
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [GuildMemberRemoveData]
$cparseJSONList :: Value -> Parser [GuildMemberRemoveData]
parseJSON :: Value -> Parser GuildMemberRemoveData
$cparseJSON :: Value -> Parser GuildMemberRemoveData
FromJSON) via CalamityJSON GuildMemberRemoveData
data GuildMemberUpdateData = GuildMemberUpdateData
{ GuildMemberUpdateData -> Snowflake Guild
guildID :: Snowflake Guild
, GuildMemberUpdateData -> AesonVector (Snowflake Role)
roles :: AesonVector (Snowflake Role)
, GuildMemberUpdateData -> User
user :: User
, GuildMemberUpdateData -> Maybe Text
nick :: Maybe Text
}
deriving (Int -> GuildMemberUpdateData -> ShowS
[GuildMemberUpdateData] -> ShowS
GuildMemberUpdateData -> String
(Int -> GuildMemberUpdateData -> ShowS)
-> (GuildMemberUpdateData -> String)
-> ([GuildMemberUpdateData] -> ShowS)
-> Show GuildMemberUpdateData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GuildMemberUpdateData] -> ShowS
$cshowList :: [GuildMemberUpdateData] -> ShowS
show :: GuildMemberUpdateData -> String
$cshow :: GuildMemberUpdateData -> String
showsPrec :: Int -> GuildMemberUpdateData -> ShowS
$cshowsPrec :: Int -> GuildMemberUpdateData -> ShowS
Show, (forall x. GuildMemberUpdateData -> Rep GuildMemberUpdateData x)
-> (forall x. Rep GuildMemberUpdateData x -> GuildMemberUpdateData)
-> Generic GuildMemberUpdateData
forall x. Rep GuildMemberUpdateData x -> GuildMemberUpdateData
forall x. GuildMemberUpdateData -> Rep GuildMemberUpdateData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GuildMemberUpdateData x -> GuildMemberUpdateData
$cfrom :: forall x. GuildMemberUpdateData -> Rep GuildMemberUpdateData x
Generic)
deriving (Value -> Parser [GuildMemberUpdateData]
Value -> Parser GuildMemberUpdateData
(Value -> Parser GuildMemberUpdateData)
-> (Value -> Parser [GuildMemberUpdateData])
-> FromJSON GuildMemberUpdateData
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [GuildMemberUpdateData]
$cparseJSONList :: Value -> Parser [GuildMemberUpdateData]
parseJSON :: Value -> Parser GuildMemberUpdateData
$cparseJSON :: Value -> Parser GuildMemberUpdateData
FromJSON) via CalamityJSON GuildMemberUpdateData
data GuildMembersChunkData = GuildMembersChunkData
{ GuildMembersChunkData -> Snowflake Guild
guildID :: Snowflake Guild
, GuildMembersChunkData -> [Member]
members :: [Member]
}
deriving (Int -> GuildMembersChunkData -> ShowS
[GuildMembersChunkData] -> ShowS
GuildMembersChunkData -> String
(Int -> GuildMembersChunkData -> ShowS)
-> (GuildMembersChunkData -> String)
-> ([GuildMembersChunkData] -> ShowS)
-> Show GuildMembersChunkData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GuildMembersChunkData] -> ShowS
$cshowList :: [GuildMembersChunkData] -> ShowS
show :: GuildMembersChunkData -> String
$cshow :: GuildMembersChunkData -> String
showsPrec :: Int -> GuildMembersChunkData -> ShowS
$cshowsPrec :: Int -> GuildMembersChunkData -> ShowS
Show, (forall x. GuildMembersChunkData -> Rep GuildMembersChunkData x)
-> (forall x. Rep GuildMembersChunkData x -> GuildMembersChunkData)
-> Generic GuildMembersChunkData
forall x. Rep GuildMembersChunkData x -> GuildMembersChunkData
forall x. GuildMembersChunkData -> Rep GuildMembersChunkData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GuildMembersChunkData x -> GuildMembersChunkData
$cfrom :: forall x. GuildMembersChunkData -> Rep GuildMembersChunkData x
Generic)
instance FromJSON GuildMembersChunkData where
parseJSON :: Value -> Parser GuildMembersChunkData
parseJSON = String
-> (Object -> Parser GuildMembersChunkData)
-> Value
-> Parser GuildMembersChunkData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"GuildMembersChunkData" ((Object -> Parser GuildMembersChunkData)
-> Value -> Parser GuildMembersChunkData)
-> (Object -> Parser GuildMembersChunkData)
-> Value
-> Parser GuildMembersChunkData
forall a b. (a -> b) -> a -> b
$ \Object
v -> do
Snowflake Guild
guildID <- Object
v Object -> Key -> Parser (Snowflake Guild)
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"guild_id"
[Member]
members' <- do
[Object]
members' <- Object
v Object -> Key -> Parser [Object]
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"members"
(Object -> Parser Member) -> [Object] -> Parser [Member]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (Value -> Parser Member
forall a. FromJSON a => Value -> Parser a
parseJSON (Value -> Parser Member)
-> (Object -> Value) -> Object -> Parser Member
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Object -> Value
Object) [Object]
members'
GuildMembersChunkData -> Parser GuildMembersChunkData
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GuildMembersChunkData -> Parser GuildMembersChunkData)
-> GuildMembersChunkData -> Parser GuildMembersChunkData
forall a b. (a -> b) -> a -> b
$ Snowflake Guild -> [Member] -> GuildMembersChunkData
GuildMembersChunkData Snowflake Guild
guildID [Member]
members'
data GuildRoleData = GuildRoleData
{ GuildRoleData -> Snowflake Guild
guildID :: Snowflake Guild
, GuildRoleData -> Role
role :: Role
}
deriving (Int -> GuildRoleData -> ShowS
[GuildRoleData] -> ShowS
GuildRoleData -> String
(Int -> GuildRoleData -> ShowS)
-> (GuildRoleData -> String)
-> ([GuildRoleData] -> ShowS)
-> Show GuildRoleData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GuildRoleData] -> ShowS
$cshowList :: [GuildRoleData] -> ShowS
show :: GuildRoleData -> String
$cshow :: GuildRoleData -> String
showsPrec :: Int -> GuildRoleData -> ShowS
$cshowsPrec :: Int -> GuildRoleData -> ShowS
Show, (forall x. GuildRoleData -> Rep GuildRoleData x)
-> (forall x. Rep GuildRoleData x -> GuildRoleData)
-> Generic GuildRoleData
forall x. Rep GuildRoleData x -> GuildRoleData
forall x. GuildRoleData -> Rep GuildRoleData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GuildRoleData x -> GuildRoleData
$cfrom :: forall x. GuildRoleData -> Rep GuildRoleData x
Generic)
deriving (Value -> Parser [GuildRoleData]
Value -> Parser GuildRoleData
(Value -> Parser GuildRoleData)
-> (Value -> Parser [GuildRoleData]) -> FromJSON GuildRoleData
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [GuildRoleData]
$cparseJSONList :: Value -> Parser [GuildRoleData]
parseJSON :: Value -> Parser GuildRoleData
$cparseJSON :: Value -> Parser GuildRoleData
FromJSON) via CalamityJSON GuildRoleData
data GuildRoleDeleteData = GuildRoleDeleteData
{ GuildRoleDeleteData -> Snowflake Guild
guildID :: Snowflake Guild
, GuildRoleDeleteData -> Snowflake Role
roleID :: Snowflake Role
}
deriving (Int -> GuildRoleDeleteData -> ShowS
[GuildRoleDeleteData] -> ShowS
GuildRoleDeleteData -> String
(Int -> GuildRoleDeleteData -> ShowS)
-> (GuildRoleDeleteData -> String)
-> ([GuildRoleDeleteData] -> ShowS)
-> Show GuildRoleDeleteData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GuildRoleDeleteData] -> ShowS
$cshowList :: [GuildRoleDeleteData] -> ShowS
show :: GuildRoleDeleteData -> String
$cshow :: GuildRoleDeleteData -> String
showsPrec :: Int -> GuildRoleDeleteData -> ShowS
$cshowsPrec :: Int -> GuildRoleDeleteData -> ShowS
Show, (forall x. GuildRoleDeleteData -> Rep GuildRoleDeleteData x)
-> (forall x. Rep GuildRoleDeleteData x -> GuildRoleDeleteData)
-> Generic GuildRoleDeleteData
forall x. Rep GuildRoleDeleteData x -> GuildRoleDeleteData
forall x. GuildRoleDeleteData -> Rep GuildRoleDeleteData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GuildRoleDeleteData x -> GuildRoleDeleteData
$cfrom :: forall x. GuildRoleDeleteData -> Rep GuildRoleDeleteData x
Generic)
deriving (Value -> Parser [GuildRoleDeleteData]
Value -> Parser GuildRoleDeleteData
(Value -> Parser GuildRoleDeleteData)
-> (Value -> Parser [GuildRoleDeleteData])
-> FromJSON GuildRoleDeleteData
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [GuildRoleDeleteData]
$cparseJSONList :: Value -> Parser [GuildRoleDeleteData]
parseJSON :: Value -> Parser GuildRoleDeleteData
$cparseJSON :: Value -> Parser GuildRoleDeleteData
FromJSON) via CalamityJSON GuildRoleDeleteData
data InviteCreateData = InviteCreateData
{ InviteCreateData -> Snowflake Channel
channelID :: Snowflake Channel
, InviteCreateData -> Text
code :: Text
, InviteCreateData -> UTCTime
createdAt :: UTCTime
, InviteCreateData -> Maybe (Snowflake Guild)
guildID :: Maybe (Snowflake Guild)
, InviteCreateData -> Maybe (Snowflake User)
inviter :: Maybe (Snowflake User)
, InviteCreateData -> Int
maxAge :: Int
, InviteCreateData -> Int
maxUses :: Int
, InviteCreateData -> Maybe (Snowflake User)
targetUser :: Maybe (Snowflake User)
, InviteCreateData -> Maybe Integer
targetUserType :: Maybe Integer
, InviteCreateData -> Bool
temporary :: Bool
, InviteCreateData -> Integer
uses :: Integer
}
deriving (Int -> InviteCreateData -> ShowS
[InviteCreateData] -> ShowS
InviteCreateData -> String
(Int -> InviteCreateData -> ShowS)
-> (InviteCreateData -> String)
-> ([InviteCreateData] -> ShowS)
-> Show InviteCreateData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InviteCreateData] -> ShowS
$cshowList :: [InviteCreateData] -> ShowS
show :: InviteCreateData -> String
$cshow :: InviteCreateData -> String
showsPrec :: Int -> InviteCreateData -> ShowS
$cshowsPrec :: Int -> InviteCreateData -> ShowS
Show, (forall x. InviteCreateData -> Rep InviteCreateData x)
-> (forall x. Rep InviteCreateData x -> InviteCreateData)
-> Generic InviteCreateData
forall x. Rep InviteCreateData x -> InviteCreateData
forall x. InviteCreateData -> Rep InviteCreateData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InviteCreateData x -> InviteCreateData
$cfrom :: forall x. InviteCreateData -> Rep InviteCreateData x
Generic)
deriving
(Value -> Parser [InviteCreateData]
Value -> Parser InviteCreateData
(Value -> Parser InviteCreateData)
-> (Value -> Parser [InviteCreateData])
-> FromJSON InviteCreateData
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [InviteCreateData]
$cparseJSONList :: Value -> Parser [InviteCreateData]
parseJSON :: Value -> Parser InviteCreateData
$cparseJSON :: Value -> Parser InviteCreateData
FromJSON)
via WithSpecialCases
'["inviter" `ExtractFieldFrom` "id", "targetUser" `ExtractFieldFrom` "id"]
InviteCreateData
data InviteDeleteData = InviteDeleteData
{ InviteDeleteData -> Snowflake Channel
channelID :: Snowflake Channel
, InviteDeleteData -> Maybe (Snowflake Guild)
guildID :: Maybe (Snowflake Guild)
, InviteDeleteData -> Text
code :: Text
}
deriving (Int -> InviteDeleteData -> ShowS
[InviteDeleteData] -> ShowS
InviteDeleteData -> String
(Int -> InviteDeleteData -> ShowS)
-> (InviteDeleteData -> String)
-> ([InviteDeleteData] -> ShowS)
-> Show InviteDeleteData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InviteDeleteData] -> ShowS
$cshowList :: [InviteDeleteData] -> ShowS
show :: InviteDeleteData -> String
$cshow :: InviteDeleteData -> String
showsPrec :: Int -> InviteDeleteData -> ShowS
$cshowsPrec :: Int -> InviteDeleteData -> ShowS
Show, (forall x. InviteDeleteData -> Rep InviteDeleteData x)
-> (forall x. Rep InviteDeleteData x -> InviteDeleteData)
-> Generic InviteDeleteData
forall x. Rep InviteDeleteData x -> InviteDeleteData
forall x. InviteDeleteData -> Rep InviteDeleteData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InviteDeleteData x -> InviteDeleteData
$cfrom :: forall x. InviteDeleteData -> Rep InviteDeleteData x
Generic)
deriving (Value -> Parser [InviteDeleteData]
Value -> Parser InviteDeleteData
(Value -> Parser InviteDeleteData)
-> (Value -> Parser [InviteDeleteData])
-> FromJSON InviteDeleteData
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [InviteDeleteData]
$cparseJSONList :: Value -> Parser [InviteDeleteData]
parseJSON :: Value -> Parser InviteDeleteData
$cparseJSON :: Value -> Parser InviteDeleteData
FromJSON) via CalamityJSON InviteDeleteData
data MessageDeleteData = MessageDeleteData
{ MessageDeleteData -> Snowflake Message
id :: Snowflake Message
, MessageDeleteData -> Snowflake Channel
channelID :: Snowflake Channel
, MessageDeleteData -> Snowflake Guild
guildID :: Snowflake Guild
}
deriving (Int -> MessageDeleteData -> ShowS
[MessageDeleteData] -> ShowS
MessageDeleteData -> String
(Int -> MessageDeleteData -> ShowS)
-> (MessageDeleteData -> String)
-> ([MessageDeleteData] -> ShowS)
-> Show MessageDeleteData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MessageDeleteData] -> ShowS
$cshowList :: [MessageDeleteData] -> ShowS
show :: MessageDeleteData -> String
$cshow :: MessageDeleteData -> String
showsPrec :: Int -> MessageDeleteData -> ShowS
$cshowsPrec :: Int -> MessageDeleteData -> ShowS
Show, (forall x. MessageDeleteData -> Rep MessageDeleteData x)
-> (forall x. Rep MessageDeleteData x -> MessageDeleteData)
-> Generic MessageDeleteData
forall x. Rep MessageDeleteData x -> MessageDeleteData
forall x. MessageDeleteData -> Rep MessageDeleteData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MessageDeleteData x -> MessageDeleteData
$cfrom :: forall x. MessageDeleteData -> Rep MessageDeleteData x
Generic)
deriving (Value -> Parser [MessageDeleteData]
Value -> Parser MessageDeleteData
(Value -> Parser MessageDeleteData)
-> (Value -> Parser [MessageDeleteData])
-> FromJSON MessageDeleteData
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [MessageDeleteData]
$cparseJSONList :: Value -> Parser [MessageDeleteData]
parseJSON :: Value -> Parser MessageDeleteData
$cparseJSON :: Value -> Parser MessageDeleteData
FromJSON) via CalamityJSON MessageDeleteData
data MessageDeleteBulkData = MessageDeleteBulkData
{ MessageDeleteBulkData -> Snowflake Guild
guildID :: Snowflake Guild
, MessageDeleteBulkData -> Snowflake Channel
channelID :: Snowflake Channel
, MessageDeleteBulkData -> [Snowflake Message]
ids :: [Snowflake Message]
}
deriving (Int -> MessageDeleteBulkData -> ShowS
[MessageDeleteBulkData] -> ShowS
MessageDeleteBulkData -> String
(Int -> MessageDeleteBulkData -> ShowS)
-> (MessageDeleteBulkData -> String)
-> ([MessageDeleteBulkData] -> ShowS)
-> Show MessageDeleteBulkData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MessageDeleteBulkData] -> ShowS
$cshowList :: [MessageDeleteBulkData] -> ShowS
show :: MessageDeleteBulkData -> String
$cshow :: MessageDeleteBulkData -> String
showsPrec :: Int -> MessageDeleteBulkData -> ShowS
$cshowsPrec :: Int -> MessageDeleteBulkData -> ShowS
Show, (forall x. MessageDeleteBulkData -> Rep MessageDeleteBulkData x)
-> (forall x. Rep MessageDeleteBulkData x -> MessageDeleteBulkData)
-> Generic MessageDeleteBulkData
forall x. Rep MessageDeleteBulkData x -> MessageDeleteBulkData
forall x. MessageDeleteBulkData -> Rep MessageDeleteBulkData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MessageDeleteBulkData x -> MessageDeleteBulkData
$cfrom :: forall x. MessageDeleteBulkData -> Rep MessageDeleteBulkData x
Generic)
deriving (Value -> Parser [MessageDeleteBulkData]
Value -> Parser MessageDeleteBulkData
(Value -> Parser MessageDeleteBulkData)
-> (Value -> Parser [MessageDeleteBulkData])
-> FromJSON MessageDeleteBulkData
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [MessageDeleteBulkData]
$cparseJSONList :: Value -> Parser [MessageDeleteBulkData]
parseJSON :: Value -> Parser MessageDeleteBulkData
$cparseJSON :: Value -> Parser MessageDeleteBulkData
FromJSON) via CalamityJSON MessageDeleteBulkData
data MessageReactionRemoveAllData = MessageReactionRemoveAllData
{ MessageReactionRemoveAllData -> Snowflake Channel
channelID :: Snowflake Channel
, MessageReactionRemoveAllData -> Snowflake Message
messageID :: Snowflake Message
, MessageReactionRemoveAllData -> Maybe (Snowflake Guild)
guildID :: Maybe (Snowflake Guild)
}
deriving (Int -> MessageReactionRemoveAllData -> ShowS
[MessageReactionRemoveAllData] -> ShowS
MessageReactionRemoveAllData -> String
(Int -> MessageReactionRemoveAllData -> ShowS)
-> (MessageReactionRemoveAllData -> String)
-> ([MessageReactionRemoveAllData] -> ShowS)
-> Show MessageReactionRemoveAllData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MessageReactionRemoveAllData] -> ShowS
$cshowList :: [MessageReactionRemoveAllData] -> ShowS
show :: MessageReactionRemoveAllData -> String
$cshow :: MessageReactionRemoveAllData -> String
showsPrec :: Int -> MessageReactionRemoveAllData -> ShowS
$cshowsPrec :: Int -> MessageReactionRemoveAllData -> ShowS
Show, (forall x.
MessageReactionRemoveAllData -> Rep MessageReactionRemoveAllData x)
-> (forall x.
Rep MessageReactionRemoveAllData x -> MessageReactionRemoveAllData)
-> Generic MessageReactionRemoveAllData
forall x.
Rep MessageReactionRemoveAllData x -> MessageReactionRemoveAllData
forall x.
MessageReactionRemoveAllData -> Rep MessageReactionRemoveAllData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MessageReactionRemoveAllData x -> MessageReactionRemoveAllData
$cfrom :: forall x.
MessageReactionRemoveAllData -> Rep MessageReactionRemoveAllData x
Generic)
deriving (Value -> Parser [MessageReactionRemoveAllData]
Value -> Parser MessageReactionRemoveAllData
(Value -> Parser MessageReactionRemoveAllData)
-> (Value -> Parser [MessageReactionRemoveAllData])
-> FromJSON MessageReactionRemoveAllData
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [MessageReactionRemoveAllData]
$cparseJSONList :: Value -> Parser [MessageReactionRemoveAllData]
parseJSON :: Value -> Parser MessageReactionRemoveAllData
$cparseJSON :: Value -> Parser MessageReactionRemoveAllData
FromJSON) via CalamityJSON MessageReactionRemoveAllData
data PresenceUpdateData = PresenceUpdateData
{ PresenceUpdateData -> Snowflake User
userID :: Snowflake User
, PresenceUpdateData -> Presence
presence :: Presence
}
deriving (Int -> PresenceUpdateData -> ShowS
[PresenceUpdateData] -> ShowS
PresenceUpdateData -> String
(Int -> PresenceUpdateData -> ShowS)
-> (PresenceUpdateData -> String)
-> ([PresenceUpdateData] -> ShowS)
-> Show PresenceUpdateData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PresenceUpdateData] -> ShowS
$cshowList :: [PresenceUpdateData] -> ShowS
show :: PresenceUpdateData -> String
$cshow :: PresenceUpdateData -> String
showsPrec :: Int -> PresenceUpdateData -> ShowS
$cshowsPrec :: Int -> PresenceUpdateData -> ShowS
Show, (forall x. PresenceUpdateData -> Rep PresenceUpdateData x)
-> (forall x. Rep PresenceUpdateData x -> PresenceUpdateData)
-> Generic PresenceUpdateData
forall x. Rep PresenceUpdateData x -> PresenceUpdateData
forall x. PresenceUpdateData -> Rep PresenceUpdateData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PresenceUpdateData x -> PresenceUpdateData
$cfrom :: forall x. PresenceUpdateData -> Rep PresenceUpdateData x
Generic)
instance FromJSON PresenceUpdateData where
parseJSON :: Value -> Parser PresenceUpdateData
parseJSON = String
-> (Object -> Parser PresenceUpdateData)
-> Value
-> Parser PresenceUpdateData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"PresenceUpdate" ((Object -> Parser PresenceUpdateData)
-> Value -> Parser PresenceUpdateData)
-> (Object -> Parser PresenceUpdateData)
-> Value
-> Parser PresenceUpdateData
forall a b. (a -> b) -> a -> b
$ \Object
v -> do
Snowflake User
user <- (Object
v Object -> Key -> Parser Object
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"user") Parser Object
-> (Object -> Parser (Snowflake User)) -> Parser (Snowflake User)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (Object -> Key -> Parser (Snowflake User)
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"id")
Presence
presence <- Value -> Parser Presence
forall a. FromJSON a => Value -> Parser a
parseJSON (Value -> Parser Presence) -> Value -> Parser Presence
forall a b. (a -> b) -> a -> b
$ Object -> Value
Object Object
v
PresenceUpdateData -> Parser PresenceUpdateData
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PresenceUpdateData -> Parser PresenceUpdateData)
-> PresenceUpdateData -> Parser PresenceUpdateData
forall a b. (a -> b) -> a -> b
$ Snowflake User -> Presence -> PresenceUpdateData
PresenceUpdateData Snowflake User
user Presence
presence
data TypingStartData = TypingStartData
{ TypingStartData -> Snowflake Channel
channelID :: Snowflake Channel
, TypingStartData -> Maybe (Snowflake Guild)
guildID :: Maybe (Snowflake Guild)
, TypingStartData -> Snowflake User
userID :: Snowflake User
, TypingStartData -> UnixTimestamp
timestamp :: UnixTimestamp
}
deriving (Int -> TypingStartData -> ShowS
[TypingStartData] -> ShowS
TypingStartData -> String
(Int -> TypingStartData -> ShowS)
-> (TypingStartData -> String)
-> ([TypingStartData] -> ShowS)
-> Show TypingStartData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TypingStartData] -> ShowS
$cshowList :: [TypingStartData] -> ShowS
show :: TypingStartData -> String
$cshow :: TypingStartData -> String
showsPrec :: Int -> TypingStartData -> ShowS
$cshowsPrec :: Int -> TypingStartData -> ShowS
Show, (forall x. TypingStartData -> Rep TypingStartData x)
-> (forall x. Rep TypingStartData x -> TypingStartData)
-> Generic TypingStartData
forall x. Rep TypingStartData x -> TypingStartData
forall x. TypingStartData -> Rep TypingStartData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TypingStartData x -> TypingStartData
$cfrom :: forall x. TypingStartData -> Rep TypingStartData x
Generic)
deriving (Value -> Parser [TypingStartData]
Value -> Parser TypingStartData
(Value -> Parser TypingStartData)
-> (Value -> Parser [TypingStartData]) -> FromJSON TypingStartData
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [TypingStartData]
$cparseJSONList :: Value -> Parser [TypingStartData]
parseJSON :: Value -> Parser TypingStartData
$cparseJSON :: Value -> Parser TypingStartData
FromJSON) via CalamityJSON TypingStartData
newtype VoiceServerUpdateData = VoiceServerUpdateData Value
deriving newtype (Int -> VoiceServerUpdateData -> ShowS
[VoiceServerUpdateData] -> ShowS
VoiceServerUpdateData -> String
(Int -> VoiceServerUpdateData -> ShowS)
-> (VoiceServerUpdateData -> String)
-> ([VoiceServerUpdateData] -> ShowS)
-> Show VoiceServerUpdateData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VoiceServerUpdateData] -> ShowS
$cshowList :: [VoiceServerUpdateData] -> ShowS
show :: VoiceServerUpdateData -> String
$cshow :: VoiceServerUpdateData -> String
showsPrec :: Int -> VoiceServerUpdateData -> ShowS
$cshowsPrec :: Int -> VoiceServerUpdateData -> ShowS
Show, Rep VoiceServerUpdateData x -> VoiceServerUpdateData
VoiceServerUpdateData -> Rep VoiceServerUpdateData x
(forall x. VoiceServerUpdateData -> Rep VoiceServerUpdateData x)
-> (forall x. Rep VoiceServerUpdateData x -> VoiceServerUpdateData)
-> Generic VoiceServerUpdateData
forall x. Rep VoiceServerUpdateData x -> VoiceServerUpdateData
forall x. VoiceServerUpdateData -> Rep VoiceServerUpdateData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
to :: Rep VoiceServerUpdateData x -> VoiceServerUpdateData
$cto :: forall x. Rep VoiceServerUpdateData x -> VoiceServerUpdateData
from :: VoiceServerUpdateData -> Rep VoiceServerUpdateData x
$cfrom :: forall x. VoiceServerUpdateData -> Rep VoiceServerUpdateData x
Generic)
deriving newtype ([VoiceServerUpdateData] -> Encoding
[VoiceServerUpdateData] -> Value
VoiceServerUpdateData -> Encoding
VoiceServerUpdateData -> Value
(VoiceServerUpdateData -> Value)
-> (VoiceServerUpdateData -> Encoding)
-> ([VoiceServerUpdateData] -> Value)
-> ([VoiceServerUpdateData] -> Encoding)
-> ToJSON VoiceServerUpdateData
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [VoiceServerUpdateData] -> Encoding
$ctoEncodingList :: [VoiceServerUpdateData] -> Encoding
toJSONList :: [VoiceServerUpdateData] -> Value
$ctoJSONList :: [VoiceServerUpdateData] -> Value
toEncoding :: VoiceServerUpdateData -> Encoding
$ctoEncoding :: VoiceServerUpdateData -> Encoding
toJSON :: VoiceServerUpdateData -> Value
$ctoJSON :: VoiceServerUpdateData -> Value
ToJSON, Value -> Parser [VoiceServerUpdateData]
Value -> Parser VoiceServerUpdateData
(Value -> Parser VoiceServerUpdateData)
-> (Value -> Parser [VoiceServerUpdateData])
-> FromJSON VoiceServerUpdateData
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [VoiceServerUpdateData]
$cparseJSONList :: Value -> Parser [VoiceServerUpdateData]
parseJSON :: Value -> Parser VoiceServerUpdateData
$cparseJSON :: Value -> Parser VoiceServerUpdateData
FromJSON)
newtype WebhooksUpdateData = WebhooksUpdateData Value
deriving newtype (Int -> WebhooksUpdateData -> ShowS
[WebhooksUpdateData] -> ShowS
WebhooksUpdateData -> String
(Int -> WebhooksUpdateData -> ShowS)
-> (WebhooksUpdateData -> String)
-> ([WebhooksUpdateData] -> ShowS)
-> Show WebhooksUpdateData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WebhooksUpdateData] -> ShowS
$cshowList :: [WebhooksUpdateData] -> ShowS
show :: WebhooksUpdateData -> String
$cshow :: WebhooksUpdateData -> String
showsPrec :: Int -> WebhooksUpdateData -> ShowS
$cshowsPrec :: Int -> WebhooksUpdateData -> ShowS
Show, Rep WebhooksUpdateData x -> WebhooksUpdateData
WebhooksUpdateData -> Rep WebhooksUpdateData x
(forall x. WebhooksUpdateData -> Rep WebhooksUpdateData x)
-> (forall x. Rep WebhooksUpdateData x -> WebhooksUpdateData)
-> Generic WebhooksUpdateData
forall x. Rep WebhooksUpdateData x -> WebhooksUpdateData
forall x. WebhooksUpdateData -> Rep WebhooksUpdateData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
to :: Rep WebhooksUpdateData x -> WebhooksUpdateData
$cto :: forall x. Rep WebhooksUpdateData x -> WebhooksUpdateData
from :: WebhooksUpdateData -> Rep WebhooksUpdateData x
$cfrom :: forall x. WebhooksUpdateData -> Rep WebhooksUpdateData x
Generic)
deriving newtype ([WebhooksUpdateData] -> Encoding
[WebhooksUpdateData] -> Value
WebhooksUpdateData -> Encoding
WebhooksUpdateData -> Value
(WebhooksUpdateData -> Value)
-> (WebhooksUpdateData -> Encoding)
-> ([WebhooksUpdateData] -> Value)
-> ([WebhooksUpdateData] -> Encoding)
-> ToJSON WebhooksUpdateData
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [WebhooksUpdateData] -> Encoding
$ctoEncodingList :: [WebhooksUpdateData] -> Encoding
toJSONList :: [WebhooksUpdateData] -> Value
$ctoJSONList :: [WebhooksUpdateData] -> Value
toEncoding :: WebhooksUpdateData -> Encoding
$ctoEncoding :: WebhooksUpdateData -> Encoding
toJSON :: WebhooksUpdateData -> Value
$ctoJSON :: WebhooksUpdateData -> Value
ToJSON, Value -> Parser [WebhooksUpdateData]
Value -> Parser WebhooksUpdateData
(Value -> Parser WebhooksUpdateData)
-> (Value -> Parser [WebhooksUpdateData])
-> FromJSON WebhooksUpdateData
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [WebhooksUpdateData]
$cparseJSONList :: Value -> Parser [WebhooksUpdateData]
parseJSON :: Value -> Parser WebhooksUpdateData
$cparseJSON :: Value -> Parser WebhooksUpdateData
FromJSON)
data ReactionEvtData = ReactionEvtData
{ ReactionEvtData -> Snowflake User
userID :: Snowflake User
, ReactionEvtData -> Snowflake Channel
channelID :: Snowflake Channel
, ReactionEvtData -> Snowflake Message
messageID :: Snowflake Message
, ReactionEvtData -> Maybe (Snowflake Guild)
guildID :: Maybe (Snowflake Guild)
, ReactionEvtData -> RawEmoji
emoji :: RawEmoji
}
deriving (ReactionEvtData -> ReactionEvtData -> Bool
(ReactionEvtData -> ReactionEvtData -> Bool)
-> (ReactionEvtData -> ReactionEvtData -> Bool)
-> Eq ReactionEvtData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReactionEvtData -> ReactionEvtData -> Bool
$c/= :: ReactionEvtData -> ReactionEvtData -> Bool
== :: ReactionEvtData -> ReactionEvtData -> Bool
$c== :: ReactionEvtData -> ReactionEvtData -> Bool
Eq, Int -> ReactionEvtData -> ShowS
[ReactionEvtData] -> ShowS
ReactionEvtData -> String
(Int -> ReactionEvtData -> ShowS)
-> (ReactionEvtData -> String)
-> ([ReactionEvtData] -> ShowS)
-> Show ReactionEvtData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReactionEvtData] -> ShowS
$cshowList :: [ReactionEvtData] -> ShowS
show :: ReactionEvtData -> String
$cshow :: ReactionEvtData -> String
showsPrec :: Int -> ReactionEvtData -> ShowS
$cshowsPrec :: Int -> ReactionEvtData -> ShowS
Show, (forall x. ReactionEvtData -> Rep ReactionEvtData x)
-> (forall x. Rep ReactionEvtData x -> ReactionEvtData)
-> Generic ReactionEvtData
forall x. Rep ReactionEvtData x -> ReactionEvtData
forall x. ReactionEvtData -> Rep ReactionEvtData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReactionEvtData x -> ReactionEvtData
$cfrom :: forall x. ReactionEvtData -> Rep ReactionEvtData x
Generic)
deriving ([ReactionEvtData] -> Encoding
[ReactionEvtData] -> Value
ReactionEvtData -> Encoding
ReactionEvtData -> Value
(ReactionEvtData -> Value)
-> (ReactionEvtData -> Encoding)
-> ([ReactionEvtData] -> Value)
-> ([ReactionEvtData] -> Encoding)
-> ToJSON ReactionEvtData
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [ReactionEvtData] -> Encoding
$ctoEncodingList :: [ReactionEvtData] -> Encoding
toJSONList :: [ReactionEvtData] -> Value
$ctoJSONList :: [ReactionEvtData] -> Value
toEncoding :: ReactionEvtData -> Encoding
$ctoEncoding :: ReactionEvtData -> Encoding
toJSON :: ReactionEvtData -> Value
$ctoJSON :: ReactionEvtData -> Value
ToJSON, Value -> Parser [ReactionEvtData]
Value -> Parser ReactionEvtData
(Value -> Parser ReactionEvtData)
-> (Value -> Parser [ReactionEvtData]) -> FromJSON ReactionEvtData
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [ReactionEvtData]
$cparseJSONList :: Value -> Parser [ReactionEvtData]
parseJSON :: Value -> Parser ReactionEvtData
$cparseJSON :: Value -> Parser ReactionEvtData
FromJSON) via CalamityJSON ReactionEvtData
deriving (HasID User) via HasIDField "userID" ReactionEvtData
deriving (HasID Channel) via HasIDField "channelID" ReactionEvtData
deriving (HasID Message) via HasIDField "messageID" ReactionEvtData