Reddit.NET  1.5
Reddit.NET is a .NET Standard library that provides easy access to the Reddit API with virtually no boilerplate code required.
Reddit.Controllers.Modmail Class Reference

Controller class for modmail. More...

Inheritance diagram for Reddit.Controllers.Modmail:
Reddit.Controllers.Internal.Monitors Reddit.Controllers.BaseController Reddit.Controllers.Internal.Validators

Public Member Functions

 Modmail (Dispatch dispatch)
 Create a new instance of the modmail controller. More...
 
ConversationContainer GetConversations (string after="", string entity="", string sort="unread", string state="all", int limit=25)
 Get conversations for a logged in user or subreddits. More...
 
ConversationContainer GetConversations (ModmailGetConversationsInput modmailGetConversationsInput)
 Get conversations for a logged in user or subreddits. More...
 
ConversationContainer GetRecentConversations (string after="", string entity="", string state="all", int limit=25)
 Get recent conversations for a logged in user or subreddits. More...
 
ConversationContainer GetRecentConversations (ModmailGetConversationsInput modmailGetConversationsInput)
 Get recent conversations for a logged in user or subreddits. More...
 
ConversationContainer GetModConversations (string after="", string entity="", string state="all", int limit=25)
 Get mod conversations for a logged in user or subreddits. More...
 
ConversationContainer GetModConversations (ModmailGetConversationsInput modmailGetConversationsInput)
 Get mod conversations for a logged in user or subreddits. More...
 
ConversationContainer GetUserConversations (string after="", string entity="", string state="all", int limit=25)
 Get user conversations for a logged in user or subreddits. More...
 
ConversationContainer GetUserConversations (ModmailGetConversationsInput modmailGetConversationsInput)
 Get user conversations for a logged in user or subreddits. More...
 
ConversationContainer GetUnreadConversations (string after="", string entity="", string state="all", int limit=25)
 Get unread conversations for a logged in user or subreddits. More...
 
ConversationContainer GetUnreadConversations (ModmailGetConversationsInput modmailGetConversationsInput)
 Get user conversations for a logged in user or subreddits. More...
 
int Count (bool useRecent=true, bool useMod=true, bool useUser=true, bool useUnread=true)
 Count the number of conversations. More...
 
ModmailConversationContainer NewConversation (string body="", string subject="", string srName="", string to="", bool isAuthorHidden=false)
 Creates a new conversation for a particular SR. This endpoint will create a ModmailConversation object as well as the first ModmailMessage within the ModmailConversation object. More...
 
async Task< ModmailConversationContainerNewConversationAsync (string body="", string subject="", string srName="", string to="", bool isAuthorHidden=false)
 Creates a new conversation for a particular SR asynchronously. This endpoint will create a ModmailConversation object as well as the first ModmailMessage within the ModmailConversation object. More...
 
ModmailConversationContainer NewConversation (ModmailNewConversationInput modmailNewConversationInput, string gRecaptchaResponse="")
 Creates a new conversation for a particular SR. This endpoint will create a ModmailConversation object as well as the first ModmailMessage within the ModmailConversation object. More...
 
async Task< ModmailConversationContainerNewConversationAsync (ModmailNewConversationInput modmailNewConversationInput)
 Creates a new conversation for a particular SR asynchronously. This endpoint will create a ModmailConversation object as well as the first ModmailMessage within the ModmailConversation object. More...
 
ModmailConversationContainer GetConversation (string conversationId, bool markRead=false)
 Returns all messages, mod actions and conversation metadata for a given conversation id. More...
 
ModmailConversationContainer NewMessage (string conversationId, string body="", bool isAuthorHidden=false, bool isInternal=false)
 Creates a new message for a particular conversation. More...
 
async Task< ModmailConversationContainerNewMessageAsync (string conversationId, string body="", bool isAuthorHidden=false, bool isInternal=false)
 Creates a new message for a particular conversation asynchronously. More...
 
ModmailConversationContainer NewMessage (string conversationId, ModmailNewMessageInput modmailNewMessageInput)
 Creates a new message for a particular conversation. More...
 
async Task< ModmailConversationContainerNewMessageAsync (string conversationId, ModmailNewMessageInput modmailNewMessageInput)
 Creates a new message for a particular conversation asynchronously. More...
 
ModmailConversationContainer MarkHighlighted (string conversationId)
 Marks a conversation as highlighted. More...
 
async Task< ModmailConversationContainerMarkHighlightedAsync (string conversationId)
 Marks a conversation as highlighted asynchronously. More...
 
ModmailConversationContainer RemoveHighlight (string conversationId)
 Removes a highlight from a conversation. More...
 
async Task< ModmailConversationContainerRemoveHighlightAsync (string conversationId)
 Removes a highlight from a conversation asynchronously. More...
 
ModmailConversationContainer Mute (string conversationId)
 Mutes the non-mod user associated with a particular conversation. More...
 
async Task< ModmailConversationContainerMuteAsync (string conversationId)
 Mutes the non-mod user associated with a particular conversation asynchronously. More...
 
ModmailConversationContainer Unmute (string conversationId)
 Unmutes the non-mod user associated with a particular conversation. More...
 
async Task< ModmailConversationContainerUnmuteAsync (string conversationId)
 Unmutes the non-mod user associated with a particular conversation asynchronously. More...
 
ModmailUser UserHistory (string conversationId)
 Returns recent posts, comments and modmail conversations for the user that started this conversation. More...
 
void MarkRead (string conversationIds)
 Marks conversations as read for the user. More...
 
async Task MarkReadAsync (string conversationIds)
 Marks conversations as read for the user asynchronously. More...
 
void MarkUnread (string conversationIds)
 Marks conversations as unread for the user. More...
 
async Task MarkUnreadAsync (string conversationIds)
 Marks conversations as unread for the user asynchronously. More...
 
ModmailSubredditContainer Subreddits ()
 Returns a list of srs that the user moderates that are also enrolled in the new modmail. More...
 
ModmailUnreadCount GetUnreadCount ()
 Endpoint to retrieve the unread conversation count by conversation state. More...
 
bool MonitorRecent (int? monitoringDelayMs=null, int? monitoringBaseDelayMs=null, List< MonitoringSchedule > schedule=null, bool? breakOnFailure=null, DateTime? monitoringExpiration=null, bool useCache=true)
 Monitor recent modmail messages as they arrive. More...
 
bool MonitorMod (int? monitoringDelayMs=null, int? monitoringBaseDelayMs=null, List< MonitoringSchedule > schedule=null, bool? breakOnFailure=null, DateTime? monitoringExpiration=null, bool useCache=true)
 Monitor mod modmail messages as they arrive. More...
 
bool MonitorUser (int? monitoringDelayMs=null, int? monitoringBaseDelayMs=null, List< MonitoringSchedule > schedule=null, bool? breakOnFailure=null, DateTime? monitoringExpiration=null, bool useCache=true)
 Monitor user modmail messages as they arrive. More...
 
bool MonitorUnread (int? monitoringDelayMs=null, int? monitoringBaseDelayMs=null, List< MonitoringSchedule > schedule=null, bool? breakOnFailure=null, DateTime? monitoringExpiration=null, bool useCache=true)
 Monitor unread modmail messages as they arrive. More...
 
bool ModmailMessagesRecentIsMonitored ()
 Whether recent is being monitored. More...
 
bool ModmailMessagesModIsMonitored ()
 Whether mod is being monitored. More...
 
bool ModmailMessagesUserIsMonitored ()
 Whether user is being monitored. More...
 
bool ModmailMessagesUnreadIsMonitored ()
 Whether unread is being monitored. More...
 
- Public Member Functions inherited from Reddit.Controllers.Internal.Monitors
 Monitors ()
 
void Wait (int ms)
 
bool IsMonitored (string key, string subKey)
 
bool IsScheduled ()
 
void WaitOrDie (string key, int timeout=60)
 
void WaitOrDie (Thread thread, int timeout=60)
 
void KillAllMonitoringThreads ()
 
- Public Member Functions inherited from Reddit.Controllers.BaseController
 BaseController ()
 Create a new Controller instance. More...
 
- Public Member Functions inherited from Reddit.Controllers.Internal.Validators
Exception BuildException (Exception ex, List< List< string >> errors)
 
dynamic Validate (dynamic obj)
 
GenericContainer Validate (GenericContainer genericContainer)
 
Generic Validate (Generic generic)
 
DynamicShortListingContainer Validate (DynamicShortListingContainer dynamicShortListingContainer)
 
DynamicShortListingData Validate (DynamicShortListingData dynamicShortListingData)
 
ImageUploadResult Validate (ImageUploadResult imageUploadResult)
 
LiveUpdateEventContainer Validate (LiveUpdateEventContainer liveUpdateEventContainer)
 
LiveThreadCreateResultContainer Validate (LiveThreadCreateResultContainer liveThreadCreateResultContainer)
 
LiveUpdateContainer Validate (LiveUpdateContainer liveUpdateContainer, int? minChildren=null)
 
SubredditSettingsContainer Validate (SubredditSettingsContainer subredditSettingsContainer)
 
SubredditSettings Validate (SubredditSettings subredditSettings)
 
List< ActionResultValidate (List< ActionResult > actionResults)
 
ActionResult Validate (ActionResult actionResult)
 
FlairListResultContainer Validate (FlairListResultContainer flairListResultContainer)
 
Flair Validate (Flair flair)
 
FlairV2 Validate (FlairV2 flairV2)
 
ModActionContainer Validate (ModActionContainer modActionContainer)
 
ModActionData Validate (ModActionData modActionData)
 
WikiPageRevisionContainer Validate (WikiPageRevisionContainer wikiPageRevisionContainer)
 
WikiPageRevisionData Validate (WikiPageRevisionData wikiPageRevisionData)
 
WikiPageSettingsContainer Validate (WikiPageSettingsContainer wikiPageSettingsContainer)
 
WikiPageSettings Validate (WikiPageSettings wikiPageSettings)
 
List< UserPrefsContainerValidate (List< UserPrefsContainer > userPrefsContainers)
 
UserPrefsContainer Validate (UserPrefsContainer userPrefsContainer)
 
UserPrefsData Validate (UserPrefsData userPrefsData)
 
PostResultShortContainer Validate (PostResultShortContainer postResultShortContainer)
 
PostResultShort Validate (PostResultShort postResultShort)
 
PostResultContainer Validate (PostResultContainer postResultContainer)
 
PostResult Validate (PostResult postResult)
 
JQueryReturn Validate (JQueryReturn jQueryReturn)
 
List<(PostContainer, CommentContainer)> Validate (List<(PostContainer, CommentContainer)> ps)
 
CommentResultContainer Validate (CommentResultContainer commentResultContainer)
 
SubredditContainer Validate (SubredditContainer subredditContainer)
 

Protected Member Functions

virtual void OnRecentUpdated (ModmailConversationsEventArgs e)
 Invoke monitoring event for recent. More...
 
virtual void OnModUpdated (ModmailConversationsEventArgs e)
 Invoke monitoring event for mod. More...
 
virtual void OnUserUpdated (ModmailConversationsEventArgs e)
 Invoke monitoring event for user. More...
 
virtual void OnUnreadUpdated (ModmailConversationsEventArgs e)
 Invoke monitoring event for unread. More...
 
void TriggerUpdate (ModmailConversationsEventArgs args, string type)
 Invoke the appropriate event for the given type. More...
 
override Thread CreateMonitoringThread (string key, string subKey, int startDelayMs=0, int? monitoringDelayMs=null)
 Creates a new monitoring thread. More...
 
- Protected Member Functions inherited from Reddit.Controllers.Internal.Monitors
bool Monitor (string key, Thread thread, string subKey)
 
void RebuildThreads (string subKey)
 
void LaunchThreadIfNotNull (string key, Thread thread)
 
void KillThread (Thread thread)
 
void KillThread (string key)
 
void ResetThreads (List< string > oldThreads)
 
- Protected Member Functions inherited from Reddit.Controllers.Internal.Validators
void CheckErrors (List< List< string >> errors)
 
void CheckErrors (List< string > errors)
 
void CheckNull (object res, string msg="Reddit API returned null response.")
 

Properties

ConversationContainerRecent [get]
 Recent modmail conversations. More...
 
ConversationContainerMod [get]
 Mod modmail conversations. More...
 
ConversationContainerUser [get]
 User modmail conversations. More...
 
ConversationContainerUnread [get]
 Unread modmail conversations. More...
 
ModmailUnreadCountUnreadCount [get]
 Unread messages count. More...
 
- Properties inherited from Reddit.Controllers.Internal.Monitors
IDictionary< string, HashSet< string > > MonitoringCache [get, set]
 An optional cache for preventing the same post from appearing multiple times during monitoring. See: https://github.com/sirkris/Reddit.NET/issues/117#issuecomment-759501039 More...
 
- Properties inherited from Reddit.Controllers.BaseController
Lists Lists [get, set]
 List-handling. More...
 

Events

EventHandler< ModmailConversationsEventArgsRecentUpdated
 Event handler for monitoring modmail (recent set). More...
 
EventHandler< ModmailConversationsEventArgsModUpdated
 Event handler for monitoring modmail (mod set). More...
 
EventHandler< ModmailConversationsEventArgsUserUpdated
 Event handler for monitoring modmail (user set). More...
 
EventHandler< ModmailConversationsEventArgsUnreadUpdated
 Event handler for monitoring modmail (unread set). More...
 

Additional Inherited Members

- Public Attributes inherited from Reddit.Controllers.Internal.Monitors
int MonitoringWaitDelayMS = 1500
 
- Protected Attributes inherited from Reddit.Controllers.Internal.Monitors
volatile bool Terminate = false
 

Detailed Description

Controller class for modmail.

Constructor & Destructor Documentation

◆ Modmail()

Reddit.Controllers.Modmail.Modmail ( Dispatch  dispatch)

Create a new instance of the modmail controller.

Parameters
dispatch

Member Function Documentation

◆ Count()

int Reddit.Controllers.Modmail.Count ( bool  useRecent = true,
bool  useMod = true,
bool  useUser = true,
bool  useUnread = true 
)

Count the number of conversations.

Parameters
useRecentCount recent conversations.
useModCount Mod conversations.
useUserCount User conversations.
useUnreadCount Unread conversations.
Returns
The number of conversations.

◆ CreateMonitoringThread()

override Thread Reddit.Controllers.Modmail.CreateMonitoringThread ( string  key,
string  subKey,
int  startDelayMs = 0,
int?  monitoringDelayMs = null 
)
protectedvirtual

Creates a new monitoring thread.

Parameters
keyMonitoring key
subKeyMonitoring subKey
startDelayMsHow long to wait before starting the thread in milliseconds (default: 0)
monitoringDelayMsHow long to wait between monitoring queries; pass null to leave it auto-managed (default: null)
Returns
The newly-created monitoring thread.

Implements Reddit.Controllers.Internal.Monitors.

◆ GetConversation()

ModmailConversationContainer Reddit.Controllers.Modmail.GetConversation ( string  conversationId,
bool  markRead = false 
)

Returns all messages, mod actions and conversation metadata for a given conversation id.

Parameters
conversationIdbase36 modmail conversation id
markReadboolean value
Returns
An object containing the conversation data.

◆ GetConversations() [1/2]

ConversationContainer Reddit.Controllers.Modmail.GetConversations ( ModmailGetConversationsInput  modmailGetConversationsInput)

Get conversations for a logged in user or subreddits.

Parameters
modmailGetConversationsInputA valid ModmailGetConversationsInput instance
Returns
The requested conversations.

◆ GetConversations() [2/2]

ConversationContainer Reddit.Controllers.Modmail.GetConversations ( string  after = "",
string  entity = "",
string  sort = "unread",
string  state = "all",
int  limit = 25 
)

Get conversations for a logged in user or subreddits.

Parameters
afterbase36 modmail conversation id
entitycomma-delimited list of subreddit names
sortone of (recent, mod, user, unread)
stateone of (new, inprogress, mod, notifications, archived, highlighted, all)
limitan integer (default: 25)
Returns
The requested conversations.

◆ GetModConversations() [1/2]

ConversationContainer Reddit.Controllers.Modmail.GetModConversations ( ModmailGetConversationsInput  modmailGetConversationsInput)

Get mod conversations for a logged in user or subreddits.

Parameters
modmailGetConversationsInputA valid ModmailGetConversationsInput instance
Returns
The requested conversations.

◆ GetModConversations() [2/2]

ConversationContainer Reddit.Controllers.Modmail.GetModConversations ( string  after = "",
string  entity = "",
string  state = "all",
int  limit = 25 
)

Get mod conversations for a logged in user or subreddits.

Parameters
afterbase36 modmail conversation id
entitycomma-delimited list of subreddit names
stateone of (new, inprogress, mod, notifications, archived, highlighted, all)
limitan integer (default: 25)
Returns
The requested conversations.

◆ GetRecentConversations() [1/2]

ConversationContainer Reddit.Controllers.Modmail.GetRecentConversations ( ModmailGetConversationsInput  modmailGetConversationsInput)

Get recent conversations for a logged in user or subreddits.

Parameters
modmailGetConversationsInputA valid ModmailGetConversationsInput instance
Returns
The requested conversations.

◆ GetRecentConversations() [2/2]

ConversationContainer Reddit.Controllers.Modmail.GetRecentConversations ( string  after = "",
string  entity = "",
string  state = "all",
int  limit = 25 
)

Get recent conversations for a logged in user or subreddits.

Parameters
afterbase36 modmail conversation id
entitycomma-delimited list of subreddit names
stateone of (new, inprogress, mod, notifications, archived, highlighted, all)
limitan integer (default: 25)
Returns
The requested conversations.

◆ GetUnreadConversations() [1/2]

ConversationContainer Reddit.Controllers.Modmail.GetUnreadConversations ( ModmailGetConversationsInput  modmailGetConversationsInput)

Get user conversations for a logged in user or subreddits.

Parameters
modmailGetConversationsInputA valid ModmailGetConversationsInput instance
Returns
The requested conversations.

◆ GetUnreadConversations() [2/2]

ConversationContainer Reddit.Controllers.Modmail.GetUnreadConversations ( string  after = "",
string  entity = "",
string  state = "all",
int  limit = 25 
)

Get unread conversations for a logged in user or subreddits.

Parameters
afterbase36 modmail conversation id
entitycomma-delimited list of subreddit names
stateone of (new, inprogress, mod, notifications, archived, highlighted, all)
limitan integer (default: 25)
Returns
The requested conversations.

◆ GetUnreadCount()

ModmailUnreadCount Reddit.Controllers.Modmail.GetUnreadCount ( )

Endpoint to retrieve the unread conversation count by conversation state.

Returns
An object with the int properties: highlighted, notifications, archived, new, inprogress, and mod.

◆ GetUserConversations() [1/2]

ConversationContainer Reddit.Controllers.Modmail.GetUserConversations ( ModmailGetConversationsInput  modmailGetConversationsInput)

Get user conversations for a logged in user or subreddits.

Parameters
modmailGetConversationsInputA valid ModmailGetConversationsInput instance
Returns
The requested conversations.

◆ GetUserConversations() [2/2]

ConversationContainer Reddit.Controllers.Modmail.GetUserConversations ( string  after = "",
string  entity = "",
string  state = "all",
int  limit = 25 
)

Get user conversations for a logged in user or subreddits.

Parameters
afterbase36 modmail conversation id
entitycomma-delimited list of subreddit names
stateone of (new, inprogress, mod, notifications, archived, highlighted, all)
limitan integer (default: 25)
Returns
The requested conversations.

◆ MarkHighlighted()

ModmailConversationContainer Reddit.Controllers.Modmail.MarkHighlighted ( string  conversationId)

Marks a conversation as highlighted.

Parameters
conversationIdbase36 modmail conversation id
Returns
An object containing the conversation data.

◆ MarkHighlightedAsync()

async Task<ModmailConversationContainer> Reddit.Controllers.Modmail.MarkHighlightedAsync ( string  conversationId)

Marks a conversation as highlighted asynchronously.

Parameters
conversationIdbase36 modmail conversation id
Returns
An object containing the conversation data.

◆ MarkRead()

void Reddit.Controllers.Modmail.MarkRead ( string  conversationIds)

Marks conversations as read for the user.

Parameters
conversationIdsA comma-separated list of items

◆ MarkReadAsync()

async Task Reddit.Controllers.Modmail.MarkReadAsync ( string  conversationIds)

Marks conversations as read for the user asynchronously.

Parameters
conversationIdsA comma-separated list of items

◆ MarkUnread()

void Reddit.Controllers.Modmail.MarkUnread ( string  conversationIds)

Marks conversations as unread for the user.

Parameters
conversationIdsA comma-separated list of items

◆ MarkUnreadAsync()

async Task Reddit.Controllers.Modmail.MarkUnreadAsync ( string  conversationIds)

Marks conversations as unread for the user asynchronously.

Parameters
conversationIdsA comma-separated list of items

◆ ModmailMessagesModIsMonitored()

bool Reddit.Controllers.Modmail.ModmailMessagesModIsMonitored ( )

Whether mod is being monitored.

Returns
Whether mod is being monitored.

◆ ModmailMessagesRecentIsMonitored()

bool Reddit.Controllers.Modmail.ModmailMessagesRecentIsMonitored ( )

Whether recent is being monitored.

Returns
Whether recent is being monitored.

◆ ModmailMessagesUnreadIsMonitored()

bool Reddit.Controllers.Modmail.ModmailMessagesUnreadIsMonitored ( )

Whether unread is being monitored.

Returns
Whether unread is being monitored.

◆ ModmailMessagesUserIsMonitored()

bool Reddit.Controllers.Modmail.ModmailMessagesUserIsMonitored ( )

Whether user is being monitored.

Returns
Whether user is being monitored.

◆ MonitorMod()

bool Reddit.Controllers.Modmail.MonitorMod ( int?  monitoringDelayMs = null,
int?  monitoringBaseDelayMs = null,
List< MonitoringSchedule schedule = null,
bool?  breakOnFailure = null,
DateTime?  monitoringExpiration = null,
bool  useCache = true 
)

Monitor mod modmail messages as they arrive.

Parameters
monitoringDelayMsThe number of milliseconds between each monitoring query; leave null to auto-manage
monitoringBaseDelayMsThe number of milliseconds between each monitoring query PER THREAD (default: 1500)
scheduleA list of one or more timeframes during which monitoring of this object will occur (default: 24/7)
breakOnFailureIf true, an exception will be thrown when a monitoring query fails; leave null to keep current setting (default: false)
monitoringExpirationIf set, monitoring will automatically stop after the specified DateTime is reached
useCacheWhether to cache the IDs of the monitoring results to prevent duplicate fires (default: true)
Returns
Whether monitoring was successfully initiated.

◆ MonitorRecent()

bool Reddit.Controllers.Modmail.MonitorRecent ( int?  monitoringDelayMs = null,
int?  monitoringBaseDelayMs = null,
List< MonitoringSchedule schedule = null,
bool?  breakOnFailure = null,
DateTime?  monitoringExpiration = null,
bool  useCache = true 
)

Monitor recent modmail messages as they arrive.

Parameters
monitoringDelayMsThe number of milliseconds between each monitoring query; leave null to auto-manage
monitoringBaseDelayMsThe number of milliseconds between each monitoring query PER THREAD (default: 1500)
scheduleA list of one or more timeframes during which monitoring of this object will occur (default: 24/7)
breakOnFailureIf true, an exception will be thrown when a monitoring query fails; leave null to keep current setting (default: false)
monitoringExpirationIf set, monitoring will automatically stop after the specified DateTime is reached
useCacheWhether to cache the IDs of the monitoring results to prevent duplicate fires (default: true)
Returns
Whether monitoring was successfully initiated.

◆ MonitorUnread()

bool Reddit.Controllers.Modmail.MonitorUnread ( int?  monitoringDelayMs = null,
int?  monitoringBaseDelayMs = null,
List< MonitoringSchedule schedule = null,
bool?  breakOnFailure = null,
DateTime?  monitoringExpiration = null,
bool  useCache = true 
)

Monitor unread modmail messages as they arrive.

Parameters
monitoringDelayMsThe number of milliseconds between each monitoring query; leave null to auto-manage
monitoringBaseDelayMsThe number of milliseconds between each monitoring query PER THREAD (default: 1500)
scheduleA list of one or more timeframes during which monitoring of this object will occur (default: 24/7)
breakOnFailureIf true, an exception will be thrown when a monitoring query fails; leave null to keep current setting (default: false)
monitoringExpirationIf set, monitoring will automatically stop after the specified DateTime is reached
useCacheWhether to cache the IDs of the monitoring results to prevent duplicate fires (default: true)
Returns
Whether monitoring was successfully initiated.

◆ MonitorUser()

bool Reddit.Controllers.Modmail.MonitorUser ( int?  monitoringDelayMs = null,
int?  monitoringBaseDelayMs = null,
List< MonitoringSchedule schedule = null,
bool?  breakOnFailure = null,
DateTime?  monitoringExpiration = null,
bool  useCache = true 
)

Monitor user modmail messages as they arrive.

Parameters
monitoringDelayMsThe number of milliseconds between each monitoring query; leave null to auto-manage
monitoringBaseDelayMsThe number of milliseconds between each monitoring query PER THREAD (default: 1500)
scheduleA list of one or more timeframes during which monitoring of this object will occur (default: 24/7)
breakOnFailureIf true, an exception will be thrown when a monitoring query fails; leave null to keep current setting (default: false)
monitoringExpirationIf set, monitoring will automatically stop after the specified DateTime is reached
useCacheWhether to cache the IDs of the monitoring results to prevent duplicate fires (default: true)
Returns
Whether monitoring was successfully initiated.

◆ Mute()

ModmailConversationContainer Reddit.Controllers.Modmail.Mute ( string  conversationId)

Mutes the non-mod user associated with a particular conversation.

Parameters
conversationIdbase36 modmail conversation id
Returns
An object containing the conversation data.

◆ MuteAsync()

async Task<ModmailConversationContainer> Reddit.Controllers.Modmail.MuteAsync ( string  conversationId)

Mutes the non-mod user associated with a particular conversation asynchronously.

Parameters
conversationIdbase36 modmail conversation id
Returns
An object containing the conversation data.

◆ NewConversation() [1/2]

ModmailConversationContainer Reddit.Controllers.Modmail.NewConversation ( ModmailNewConversationInput  modmailNewConversationInput,
string  gRecaptchaResponse = "" 
)

Creates a new conversation for a particular SR. This endpoint will create a ModmailConversation object as well as the first ModmailMessage within the ModmailConversation object.

Parameters
modmailNewConversationInputA valid ModmailNewConversationInput instance
gRecaptchaResponse
Returns
An object containing the conversation data.

◆ NewConversation() [2/2]

ModmailConversationContainer Reddit.Controllers.Modmail.NewConversation ( string  body = "",
string  subject = "",
string  srName = "",
string  to = "",
bool  isAuthorHidden = false 
)

Creates a new conversation for a particular SR. This endpoint will create a ModmailConversation object as well as the first ModmailMessage within the ModmailConversation object.

Parameters
bodyraw markdown text
subjecta string no longer than 100 characters
toModmail conversation recipient username
isAuthorHiddenboolean value
srNamesubreddit name
Returns
An object containing the conversation data.

◆ NewConversationAsync() [1/2]

async Task<ModmailConversationContainer> Reddit.Controllers.Modmail.NewConversationAsync ( ModmailNewConversationInput  modmailNewConversationInput)

Creates a new conversation for a particular SR asynchronously. This endpoint will create a ModmailConversation object as well as the first ModmailMessage within the ModmailConversation object.

Parameters
modmailNewConversationInputA valid ModmailNewConversationInput instance

◆ NewConversationAsync() [2/2]

async Task<ModmailConversationContainer> Reddit.Controllers.Modmail.NewConversationAsync ( string  body = "",
string  subject = "",
string  srName = "",
string  to = "",
bool  isAuthorHidden = false 
)

Creates a new conversation for a particular SR asynchronously. This endpoint will create a ModmailConversation object as well as the first ModmailMessage within the ModmailConversation object.

Parameters
bodyraw markdown text
subjecta string no longer than 100 characters
toModmail conversation recipient username
isAuthorHiddenboolean value
srNamesubreddit name

◆ NewMessage() [1/2]

ModmailConversationContainer Reddit.Controllers.Modmail.NewMessage ( string  conversationId,
ModmailNewMessageInput  modmailNewMessageInput 
)

Creates a new message for a particular conversation.

Parameters
conversationIdbase36 modmail conversation id
modmailNewMessageInputA valid ModmailNewMessageInput instance
Returns
An object containing the conversation data.

◆ NewMessage() [2/2]

ModmailConversationContainer Reddit.Controllers.Modmail.NewMessage ( string  conversationId,
string  body = "",
bool  isAuthorHidden = false,
bool  isInternal = false 
)

Creates a new message for a particular conversation.

Parameters
conversationIdbase36 modmail conversation id
bodyraw markdown text
isAuthorHiddenboolean value
isInternalboolean value
Returns
An object containing the conversation data.

◆ NewMessageAsync() [1/2]

async Task<ModmailConversationContainer> Reddit.Controllers.Modmail.NewMessageAsync ( string  conversationId,
ModmailNewMessageInput  modmailNewMessageInput 
)

Creates a new message for a particular conversation asynchronously.

Parameters
conversationIdbase36 modmail conversation id
modmailNewMessageInputA valid ModmailNewMessageInput instance

◆ NewMessageAsync() [2/2]

async Task<ModmailConversationContainer> Reddit.Controllers.Modmail.NewMessageAsync ( string  conversationId,
string  body = "",
bool  isAuthorHidden = false,
bool  isInternal = false 
)

Creates a new message for a particular conversation asynchronously.

Parameters
conversationIdbase36 modmail conversation id
bodyraw markdown text
isAuthorHiddenboolean value
isInternalboolean value

◆ OnModUpdated()

virtual void Reddit.Controllers.Modmail.OnModUpdated ( ModmailConversationsEventArgs  e)
protectedvirtual

Invoke monitoring event for mod.

Parameters
eA valid ModmailConversationsEventArgs instance

◆ OnRecentUpdated()

virtual void Reddit.Controllers.Modmail.OnRecentUpdated ( ModmailConversationsEventArgs  e)
protectedvirtual

Invoke monitoring event for recent.

Parameters
eA valid ModmailConversationsEventArgs instance

◆ OnUnreadUpdated()

virtual void Reddit.Controllers.Modmail.OnUnreadUpdated ( ModmailConversationsEventArgs  e)
protectedvirtual

Invoke monitoring event for unread.

Parameters
eA valid ModmailConversationsEventArgs instance

◆ OnUserUpdated()

virtual void Reddit.Controllers.Modmail.OnUserUpdated ( ModmailConversationsEventArgs  e)
protectedvirtual

Invoke monitoring event for user.

Parameters
eA valid ModmailConversationsEventArgs instance

◆ RemoveHighlight()

ModmailConversationContainer Reddit.Controllers.Modmail.RemoveHighlight ( string  conversationId)

Removes a highlight from a conversation.

Parameters
conversationIdbase36 modmail conversation id
Returns
An object containing the conversation data.

◆ RemoveHighlightAsync()

async Task<ModmailConversationContainer> Reddit.Controllers.Modmail.RemoveHighlightAsync ( string  conversationId)

Removes a highlight from a conversation asynchronously.

Parameters
conversationIdbase36 modmail conversation id
Returns
An object containing the conversation data.

◆ Subreddits()

ModmailSubredditContainer Reddit.Controllers.Modmail.Subreddits ( )

Returns a list of srs that the user moderates that are also enrolled in the new modmail.

Returns
A list of subreddits.

◆ TriggerUpdate()

void Reddit.Controllers.Modmail.TriggerUpdate ( ModmailConversationsEventArgs  args,
string  type 
)
protected

Invoke the appropriate event for the given type.

Parameters
argsA valid ModmailConversationsEventArgs instance
typeOne of: (recent, mod, user, unread)

◆ Unmute()

ModmailConversationContainer Reddit.Controllers.Modmail.Unmute ( string  conversationId)

Unmutes the non-mod user associated with a particular conversation.

Parameters
conversationIdbase36 modmail conversation id
Returns
An object containing the conversation data.

◆ UnmuteAsync()

async Task<ModmailConversationContainer> Reddit.Controllers.Modmail.UnmuteAsync ( string  conversationId)

Unmutes the non-mod user associated with a particular conversation asynchronously.

Parameters
conversationIdbase36 modmail conversation id
Returns
An object containing the conversation data.

◆ UserHistory()

ModmailUser Reddit.Controllers.Modmail.UserHistory ( string  conversationId)

Returns recent posts, comments and modmail conversations for the user that started this conversation.

Parameters
conversationIdbase36 modmail conversation id
Returns
An object containing the user data.

Property Documentation

◆ Mod

ConversationContainer? Reddit.Controllers.Modmail.Mod
get

Mod modmail conversations.

◆ Recent

ConversationContainer? Reddit.Controllers.Modmail.Recent
get

Recent modmail conversations.

◆ Unread

ConversationContainer? Reddit.Controllers.Modmail.Unread
get

Unread modmail conversations.

◆ UnreadCount

ModmailUnreadCount? Reddit.Controllers.Modmail.UnreadCount
get

Unread messages count.

◆ User

ConversationContainer? Reddit.Controllers.Modmail.User
get

User modmail conversations.

Event Documentation

◆ ModUpdated

EventHandler<ModmailConversationsEventArgs> Reddit.Controllers.Modmail.ModUpdated

Event handler for monitoring modmail (mod set).

◆ RecentUpdated

EventHandler<ModmailConversationsEventArgs> Reddit.Controllers.Modmail.RecentUpdated

Event handler for monitoring modmail (recent set).

◆ UnreadUpdated

EventHandler<ModmailConversationsEventArgs> Reddit.Controllers.Modmail.UnreadUpdated

Event handler for monitoring modmail (unread set).

◆ UserUpdated

EventHandler<ModmailConversationsEventArgs> Reddit.Controllers.Modmail.UserUpdated

Event handler for monitoring modmail (user set).


The documentation for this class was generated from the following file: