heddit-0.0.1: Reddit API bindings
Copyright(c) 2021 Rory Tyler Hayford
LicenseBSD-3-Clause
Maintainerrory.hayford@protonmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Network.Reddit.Message

Contents

Description

 
Synopsis

Actions

getInbox :: MonadReddit m => Paginator MessageID Message -> m (Listing MessageID Message) Source #

Get the Message inbox for the currently authenticated user

getUnread :: MonadReddit m => Paginator MessageID Message -> m (Listing MessageID Message) Source #

Get the unread Messages of the currently authenticated user

getSent :: MonadReddit m => Paginator MessageID Message -> m (Listing MessageID Message) Source #

Get the Messages sent by the currently authenticated user

markRead :: MonadReddit m => MessageID -> m () Source #

Mark a Message as read

sendMessage :: MonadReddit m => NewMessage -> m () Source #

Send a NewMessage to another user

replyToMessage :: MonadReddit m => MessageID -> Body -> m Message Source #

Reply to a Message, returning the newly created Message

reportMessage :: MonadReddit m => Report -> MessageID -> m () Source #

Report a message, bringing it to the attention of the Reddit admins

Types

data NewMessage Source #

For sending new Messages via the compose API endpoint

Instances

Instances details
Eq NewMessage Source # 
Instance details

Defined in Network.Reddit.Types.Message

Show NewMessage Source # 
Instance details

Defined in Network.Reddit.Types.Message

Generic NewMessage Source # 
Instance details

Defined in Network.Reddit.Types.Message

Associated Types

type Rep NewMessage :: Type -> Type #

ToForm NewMessage Source # 
Instance details

Defined in Network.Reddit.Types.Message

Methods

toForm :: NewMessage -> Form #

type Rep NewMessage Source # 
Instance details

Defined in Network.Reddit.Types.Message

type Rep NewMessage = D1 ('MetaData "NewMessage" "Network.Reddit.Types.Message" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "NewMessage" 'PrefixI 'True) (S1 ('MetaSel ('Just "subject") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Subject) :*: (S1 ('MetaSel ('Just "message") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Body) :*: S1 ('MetaSel ('Just "dest") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Username))))

newtype PrivateMessageID Source #

A private message ID

Constructors

PrivateMessageID Text 

Instances

Instances details
Eq PrivateMessageID Source # 
Instance details

Defined in Network.Reddit.Types.Message

Ord PrivateMessageID Source # 
Instance details

Defined in Network.Reddit.Types.Message

Show PrivateMessageID Source # 
Instance details

Defined in Network.Reddit.Types.Message

Generic PrivateMessageID Source # 
Instance details

Defined in Network.Reddit.Types.Message

Associated Types

type Rep PrivateMessageID :: Type -> Type #

FromJSON PrivateMessageID Source # 
Instance details

Defined in Network.Reddit.Types.Message

ToHttpApiData PrivateMessageID Source # 
Instance details

Defined in Network.Reddit.Types.Message

Thing PrivateMessageID Source # 
Instance details

Defined in Network.Reddit.Types.Message

type Rep PrivateMessageID Source # 
Instance details

Defined in Network.Reddit.Types.Message

type Rep PrivateMessageID = D1 ('MetaData "PrivateMessageID" "Network.Reddit.Types.Message" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'True) (C1 ('MetaCons "PrivateMessageID" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data MessageID Source #

This can be CommentID for replies to a comment, or a PrivateMessageID for private messages. Querying one's inbox or unread messages can provide both types

Instances

Instances details
Eq MessageID Source # 
Instance details

Defined in Network.Reddit.Types.Message

Ord MessageID Source # 
Instance details

Defined in Network.Reddit.Types.Message

Show MessageID Source # 
Instance details

Defined in Network.Reddit.Types.Message

Generic MessageID Source # 
Instance details

Defined in Network.Reddit.Types.Message

Associated Types

type Rep MessageID :: Type -> Type #

FromJSON MessageID Source # 
Instance details

Defined in Network.Reddit.Types.Message

ToHttpApiData MessageID Source # 
Instance details

Defined in Network.Reddit.Types.Message

Thing MessageID Source # 
Instance details

Defined in Network.Reddit.Types.Message

type Rep MessageID Source # 
Instance details

Defined in Network.Reddit.Types.Message

type Rep MessageID = D1 ('MetaData "MessageID" "Network.Reddit.Types.Message" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "CommentReply" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CommentID)) :+: C1 ('MetaCons "PrivateMessage" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 PrivateMessageID)))

data MessageOpts Source #

Options for requesting and paginating Listings of Messages

Constructors

MessageOpts Bool 

Instances

Instances details
Eq MessageOpts Source # 
Instance details

Defined in Network.Reddit.Types.Message

Show MessageOpts Source # 
Instance details

Defined in Network.Reddit.Types.Message

Generic MessageOpts Source # 
Instance details

Defined in Network.Reddit.Types.Message

Associated Types

type Rep MessageOpts :: Type -> Type #

ToForm MessageOpts Source # 
Instance details

Defined in Network.Reddit.Types.Message

Methods

toForm :: MessageOpts -> Form #

type Rep MessageOpts Source # 
Instance details

Defined in Network.Reddit.Types.Message

type Rep MessageOpts = D1 ('MetaData "MessageOpts" "Network.Reddit.Types.Message" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "MessageOpts" 'PrefixI 'True) (S1 ('MetaSel ('Just "mark") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool)))

data Message Source #

A private message or comment reply

Instances

Instances details
Eq Message Source # 
Instance details

Defined in Network.Reddit.Types.Message

Methods

(==) :: Message -> Message -> Bool #

(/=) :: Message -> Message -> Bool #

Show Message Source # 
Instance details

Defined in Network.Reddit.Types.Message

Generic Message Source # 
Instance details

Defined in Network.Reddit.Types.Message

Associated Types

type Rep Message :: Type -> Type #

Methods

from :: Message -> Rep Message x #

to :: Rep Message x -> Message #

FromJSON Message Source # 
Instance details

Defined in Network.Reddit.Types.Message

Paginable Message Source # 
Instance details

Defined in Network.Reddit.Types.Message

type Rep Message Source # 
Instance details

Defined in Network.Reddit.Types.Message

type PaginateOptions Message Source # 
Instance details

Defined in Network.Reddit.Types.Message

type PaginateThing Message Source # 
Instance details

Defined in Network.Reddit.Types.Message