-- | Message reactions
module Calamity.Types.Model.Channel.Reaction
    ( Reaction(..) ) where

import           Calamity.Internal.AesonThings
import {-# SOURCE #-} Calamity.Types.Model.Channel
import {-# SOURCE #-} Calamity.Types.Model.Channel.Message
import           Calamity.Types.Model.Guild.Emoji
import {-# SOURCE #-} Calamity.Types.Model.Guild.Guild
import           Calamity.Types.Model.User
import           Calamity.Types.Snowflake

import           Data.Aeson

import           GHC.Generics

import           TextShow
import qualified TextShow.Generic                     as TSG

data Reaction = Reaction
  { Reaction -> Snowflake User
userID    :: Snowflake User
  , Reaction -> Snowflake Channel
channelID :: Snowflake Channel
  , Reaction -> Snowflake Message
messageID :: Snowflake Message
  , Reaction -> Maybe (Snowflake Guild)
guildID   :: Maybe (Snowflake Guild)
  , Reaction -> RawEmoji
emoji     :: RawEmoji
  }
  deriving ( Reaction -> Reaction -> Bool
(Reaction -> Reaction -> Bool)
-> (Reaction -> Reaction -> Bool) -> Eq Reaction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Reaction -> Reaction -> Bool
$c/= :: Reaction -> Reaction -> Bool
== :: Reaction -> Reaction -> Bool
$c== :: Reaction -> Reaction -> Bool
Eq, Int -> Reaction -> ShowS
[Reaction] -> ShowS
Reaction -> String
(Int -> Reaction -> ShowS)
-> (Reaction -> String) -> ([Reaction] -> ShowS) -> Show Reaction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Reaction] -> ShowS
$cshowList :: [Reaction] -> ShowS
show :: Reaction -> String
$cshow :: Reaction -> String
showsPrec :: Int -> Reaction -> ShowS
$cshowsPrec :: Int -> Reaction -> ShowS
Show, (forall x. Reaction -> Rep Reaction x)
-> (forall x. Rep Reaction x -> Reaction) -> Generic Reaction
forall x. Rep Reaction x -> Reaction
forall x. Reaction -> Rep Reaction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Reaction x -> Reaction
$cfrom :: forall x. Reaction -> Rep Reaction x
Generic )
  deriving ( Int -> Reaction -> Builder
Int -> Reaction -> Text
Int -> Reaction -> Text
[Reaction] -> Builder
[Reaction] -> Text
[Reaction] -> Text
Reaction -> Builder
Reaction -> Text
Reaction -> Text
(Int -> Reaction -> Builder)
-> (Reaction -> Builder)
-> ([Reaction] -> Builder)
-> (Int -> Reaction -> Text)
-> (Reaction -> Text)
-> ([Reaction] -> Text)
-> (Int -> Reaction -> Text)
-> (Reaction -> Text)
-> ([Reaction] -> Text)
-> TextShow Reaction
forall a.
(Int -> a -> Builder)
-> (a -> Builder)
-> ([a] -> Builder)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> TextShow a
showtlList :: [Reaction] -> Text
$cshowtlList :: [Reaction] -> Text
showtl :: Reaction -> Text
$cshowtl :: Reaction -> Text
showtlPrec :: Int -> Reaction -> Text
$cshowtlPrec :: Int -> Reaction -> Text
showtList :: [Reaction] -> Text
$cshowtList :: [Reaction] -> Text
showt :: Reaction -> Text
$cshowt :: Reaction -> Text
showtPrec :: Int -> Reaction -> Text
$cshowtPrec :: Int -> Reaction -> Text
showbList :: [Reaction] -> Builder
$cshowbList :: [Reaction] -> Builder
showb :: Reaction -> Builder
$cshowb :: Reaction -> Builder
showbPrec :: Int -> Reaction -> Builder
$cshowbPrec :: Int -> Reaction -> Builder
TextShow ) via TSG.FromGeneric Reaction
  deriving ( [Reaction] -> Encoding
[Reaction] -> Value
Reaction -> Encoding
Reaction -> Value
(Reaction -> Value)
-> (Reaction -> Encoding)
-> ([Reaction] -> Value)
-> ([Reaction] -> Encoding)
-> ToJSON Reaction
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [Reaction] -> Encoding
$ctoEncodingList :: [Reaction] -> Encoding
toJSONList :: [Reaction] -> Value
$ctoJSONList :: [Reaction] -> Value
toEncoding :: Reaction -> Encoding
$ctoEncoding :: Reaction -> Encoding
toJSON :: Reaction -> Value
$ctoJSON :: Reaction -> Value
ToJSON, Value -> Parser [Reaction]
Value -> Parser Reaction
(Value -> Parser Reaction)
-> (Value -> Parser [Reaction]) -> FromJSON Reaction
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Reaction]
$cparseJSONList :: Value -> Parser [Reaction]
parseJSON :: Value -> Parser Reaction
$cparseJSON :: Value -> Parser Reaction
FromJSON ) via CalamityJSON Reaction
  deriving ( HasID User ) via HasIDField "userID" Reaction
  deriving ( HasID Channel ) via HasIDField "channelID" Reaction
  deriving ( HasID Message ) via HasIDField "messageID" Reaction