![]() |
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.
|
Controller class for private messages. More...
Public Member Functions | |
| PrivateMessages (Dispatch dispatch, List< Message > inbox=null, List< Message > unread=null, List< Message > sent=null) | |
| Create a new instance of the private messages controller. More... | |
| List< Message > | GetMessages (string where, bool mark=true, int limit=25, string after="", string before="", string show="all", bool srDetail=false, bool includeCategories=false, int count=0, string mid="") |
| Retrieve private messages for the current user. More... | |
| List< Message > | GetMessages (string where, PrivateMessagesGetMessagesInput privateMessagesGetMessagesInput) |
| Retrieve private messages for the current user. More... | |
| List< Message > | GetMessagesInbox (bool mark=true, int limit=25, string after="", string before="", string show="all", bool srDetail=false, bool includeCategories=false, int count=0, string mid="") |
| Retrieve private inbox messages for the current user. More... | |
| List< Message > | GetMessagesUnread (bool mark=true, int limit=25, string after="", string before="", string show="all", bool srDetail=false, bool includeCategories=false, int count=0, string mid="") |
| Retrieve private unread messages for the current user. More... | |
| List< Message > | GetMessagesSent (bool mark=true, int limit=25, string after="", string before="", string show="all", bool srDetail=false, bool includeCategories=false, int count=0, string mid="") |
| Retrieve private sent messages for the current user. More... | |
| void | MarkAllRead (string filterTypes="") |
| Queue up marking all messages for a user as read. This may take some time, and returns 202 to acknowledge acceptance of the request. More... | |
| async Task | MarkAllReadAsync (string filterTypes="") |
| Asynchronously queue up marking all messages for a user as read. This may take some time, and returns 202 to acknowledge acceptance of the request. More... | |
| void | CollapseMessage (string ids) |
| Collapse a message. More... | |
| async Task | CollapseMessageAsync (string ids) |
| Collapse a message asynchronously. More... | |
| void | DeleteMessage (string id) |
| Delete messages from the recipient's view of their inbox. More... | |
| async Task | DeleteMessageAsync (string id) |
| Delete messages from the recipient's view of their inbox asynchronously. More... | |
| void | ReadMessage (string ids) |
| Mark a message as read. More... | |
| async Task | ReadMessageAsync (string ids) |
| Mark a message as read asynchronously. More... | |
| void | UncollapseMessage (string ids) |
| Uncollapse a message. More... | |
| async Task | UncollapseMessageAsync (string ids) |
| Uncollapse a message asynchronously. More... | |
| void | UnreadMessage (string ids) |
| Mark a message as unread. More... | |
| async Task | UnreadMessageAsync (string ids) |
| Mark a message as unread asynchronously. More... | |
| void | Compose (string to, string subject, string text, string fromSr="", string gRecaptchaResponse="") |
| Send a private message. More... | |
| async Task | ComposeAsync (string to, string subject, string text, string fromSr="", string gRecaptchaResponse="") |
| Send a private message asynchronously. More... | |
| void | Compose (PrivateMessagesComposeInput privateMessagesComposeInput, string gRecaptchaResponse="") |
| Send a private message. More... | |
| async Task | ComposeAsync (PrivateMessagesComposeInput privateMessagesComposeInput, string gRecaptchaResponse="") |
| Send a private message asynchronously. More... | |
| MessageContainer | Reply (LinksAndCommentsThingInput linksAndCommentsThingInput) |
| Reply to a private message. More... | |
| async Task< MessageContainer > | ReplyAsync (LinksAndCommentsThingInput linksAndCommentsThingInput) |
| Reply to a private message asynchronously. More... | |
| bool | MonitorInbox (int? monitoringDelayMs=null, int? monitoringBaseDelayMs=null, List< MonitoringSchedule > schedule=null, bool? breakOnFailure=null, DateTime? monitoringExpiration=null, bool useCache=true) |
| Monitor inbox messages. More... | |
| bool | MonitorUnread (int? monitoringDelayMs=null, int? monitoringBaseDelayMs=null, List< MonitoringSchedule > schedule=null, bool? breakOnFailure=null, DateTime? monitoringExpiration=null, bool useCache=true) |
| Monitor unread messages. More... | |
| bool | MonitorSent (int? monitoringDelayMs=null, int? monitoringBaseDelayMs=null, List< MonitoringSchedule > schedule=null, bool? breakOnFailure=null, DateTime? monitoringExpiration=null, bool useCache=true) |
| Monitor sent messages. More... | |
| bool | PrivateMessagesInboxIsMonitored () |
| Whether inbox is being monitored. More... | |
| bool | PrivateMessagesUnreadIsMonitored () |
| Whether unread is being monitored. More... | |
| bool | PrivateMessagesSentIsMonitored () |
| Whether sent 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< ActionResult > | Validate (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< UserPrefsContainer > | Validate (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 | OnInboxUpdated (MessagesUpdateEventArgs e) |
| Invoke monitoring event for inbox. More... | |
| virtual void | OnUnreadUpdated (MessagesUpdateEventArgs e) |
| Invoke monitoring event for unread. More... | |
| virtual void | OnSentUpdated (MessagesUpdateEventArgs e) |
| Invoke monitoring event for sent. More... | |
| void | TriggerUpdate (MessagesUpdateEventArgs 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 | |
| List< Message >? | Inbox [get] |
| List of inbox messages. More... | |
| List< Message >? | Unread [get] |
| List of unread messages. More... | |
| List< Message >? | Sent [get] |
| List of sent messages. 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< MessagesUpdateEventArgs > | InboxUpdated |
| Event handler for monitoring inbox. More... | |
| EventHandler< MessagesUpdateEventArgs > | UnreadUpdated |
| Event handler for monitoring unread. More... | |
| EventHandler< MessagesUpdateEventArgs > | SentUpdated |
| Event handler for monitoring sent. 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 |
Controller class for private messages.
| Reddit.Controllers.PrivateMessages.PrivateMessages | ( | Dispatch | dispatch, |
| List< Message > | inbox = null, |
||
| List< Message > | unread = null, |
||
| List< Message > | sent = null |
||
| ) |
Create a new instance of the private messages controller.
| dispatch | |
| inbox | |
| unread | |
| sent |
| void Reddit.Controllers.PrivateMessages.CollapseMessage | ( | string | ids | ) |
Collapse a message.
| ids | A comma-separated list of thing fullnames |
| async Task Reddit.Controllers.PrivateMessages.CollapseMessageAsync | ( | string | ids | ) |
Collapse a message asynchronously.
| ids | A comma-separated list of thing fullnames |
| void Reddit.Controllers.PrivateMessages.Compose | ( | PrivateMessagesComposeInput | privateMessagesComposeInput, |
| string | gRecaptchaResponse = "" |
||
| ) |
Send a private message.
| privateMessagesComposeInput | A valid PrivateMessagesComposeInput instance |
| gRecaptchaResponse |
| void Reddit.Controllers.PrivateMessages.Compose | ( | string | to, |
| string | subject, | ||
| string | text, | ||
| string | fromSr = "", |
||
| string | gRecaptchaResponse = "" |
||
| ) |
Send a private message.
| to | the name of an existing user |
| subject | a string no longer than 100 characters |
| text | raw markdown text |
| fromSr | subreddit name |
| gRecaptchaResponse |
| async Task Reddit.Controllers.PrivateMessages.ComposeAsync | ( | PrivateMessagesComposeInput | privateMessagesComposeInput, |
| string | gRecaptchaResponse = "" |
||
| ) |
Send a private message asynchronously.
| privateMessagesComposeInput | A valid PrivateMessagesComposeInput instance |
| gRecaptchaResponse |
| async Task Reddit.Controllers.PrivateMessages.ComposeAsync | ( | string | to, |
| string | subject, | ||
| string | text, | ||
| string | fromSr = "", |
||
| string | gRecaptchaResponse = "" |
||
| ) |
Send a private message asynchronously.
| to | the name of an existing user |
| subject | a string no longer than 100 characters |
| text | raw markdown text |
| fromSr | subreddit name |
| gRecaptchaResponse |
|
protectedvirtual |
Creates a new monitoring thread.
| key | Monitoring key |
| subKey | Monitoring subKey |
| startDelayMs | How long to wait before starting the thread in milliseconds (default: 0) |
| monitoringDelayMs | How long to wait between monitoring queries; pass null to leave it auto-managed (default: null) |
Implements Reddit.Controllers.Internal.Monitors.
| void Reddit.Controllers.PrivateMessages.DeleteMessage | ( | string | id | ) |
Delete messages from the recipient's view of their inbox.
| id | fullname of a thing |
| async Task Reddit.Controllers.PrivateMessages.DeleteMessageAsync | ( | string | id | ) |
Delete messages from the recipient's view of their inbox asynchronously.
| id | fullname of a thing |
| List<Message> Reddit.Controllers.PrivateMessages.GetMessages | ( | string | where, |
| bool | mark = true, |
||
| int | limit = 25, |
||
| string | after = "", |
||
| string | before = "", |
||
| string | show = "all", |
||
| bool | srDetail = false, |
||
| bool | includeCategories = false, |
||
| int | count = 0, |
||
| string | mid = "" |
||
| ) |
Retrieve private messages for the current user.
| where | One of (inbox, unread, sent) |
| mark | one of (true, false) |
| limit | the maximum number of items desired (default: 25, maximum: 100) |
| after | fullname of a thing |
| before | fullname of a thing |
| show | (optional) the string all |
| srDetail | (optional) expand subreddits |
| includeCategories | boolean value |
| count | a positive integer (default: 0) |
| mid |
| List<Message> Reddit.Controllers.PrivateMessages.GetMessages | ( | string | where, |
| PrivateMessagesGetMessagesInput | privateMessagesGetMessagesInput | ||
| ) |
Retrieve private messages for the current user.
| where | One of (inbox, unread, sent) |
| privateMessagesGetMessagesInput | A valid PrivateMessagesGetMessagesInput instance |
| List<Message> Reddit.Controllers.PrivateMessages.GetMessagesInbox | ( | bool | mark = true, |
| int | limit = 25, |
||
| string | after = "", |
||
| string | before = "", |
||
| string | show = "all", |
||
| bool | srDetail = false, |
||
| bool | includeCategories = false, |
||
| int | count = 0, |
||
| string | mid = "" |
||
| ) |
Retrieve private inbox messages for the current user.
| mark | one of (true, false) |
| limit | the maximum number of items desired (default: 25, maximum: 100) |
| after | fullname of a thing |
| before | fullname of a thing |
| show | (optional) the string all |
| srDetail | (optional) expand subreddits |
| includeCategories | boolean value |
| count | a positive integer (default: 0) |
| mid |
| List<Message> Reddit.Controllers.PrivateMessages.GetMessagesSent | ( | bool | mark = true, |
| int | limit = 25, |
||
| string | after = "", |
||
| string | before = "", |
||
| string | show = "all", |
||
| bool | srDetail = false, |
||
| bool | includeCategories = false, |
||
| int | count = 0, |
||
| string | mid = "" |
||
| ) |
Retrieve private sent messages for the current user.
| mark | one of (true, false) |
| limit | the maximum number of items desired (default: 25, maximum: 100) |
| after | fullname of a thing |
| before | fullname of a thing |
| show | (optional) the string all |
| srDetail | (optional) expand subreddits |
| includeCategories | boolean value |
| count | a positive integer (default: 0) |
| mid |
| List<Message> Reddit.Controllers.PrivateMessages.GetMessagesUnread | ( | bool | mark = true, |
| int | limit = 25, |
||
| string | after = "", |
||
| string | before = "", |
||
| string | show = "all", |
||
| bool | srDetail = false, |
||
| bool | includeCategories = false, |
||
| int | count = 0, |
||
| string | mid = "" |
||
| ) |
Retrieve private unread messages for the current user.
| mark | one of (true, false) |
| limit | the maximum number of items desired (default: 25, maximum: 100) |
| after | fullname of a thing |
| before | fullname of a thing |
| show | (optional) the string all |
| srDetail | (optional) expand subreddits |
| includeCategories | boolean value |
| count | a positive integer (default: 0) |
| mid |
| void Reddit.Controllers.PrivateMessages.MarkAllRead | ( | string | filterTypes = "" | ) |
Queue up marking all messages for a user as read. This may take some time, and returns 202 to acknowledge acceptance of the request.
| filterTypes | A comma-separated list of items |
| async Task Reddit.Controllers.PrivateMessages.MarkAllReadAsync | ( | string | filterTypes = "" | ) |
Asynchronously queue up marking all messages for a user as read. This may take some time, and returns 202 to acknowledge acceptance of the request.
| filterTypes | A comma-separated list of items |
| bool Reddit.Controllers.PrivateMessages.MonitorInbox | ( | int? | monitoringDelayMs = null, |
| int? | monitoringBaseDelayMs = null, |
||
| List< MonitoringSchedule > | schedule = null, |
||
| bool? | breakOnFailure = null, |
||
| DateTime? | monitoringExpiration = null, |
||
| bool | useCache = true |
||
| ) |
Monitor inbox messages.
| monitoringDelayMs | The number of milliseconds between each monitoring query; leave null to auto-manage |
| monitoringBaseDelayMs | The number of milliseconds between each monitoring query PER THREAD (default: 1500) |
| schedule | A list of one or more timeframes during which monitoring of this object will occur (default: 24/7) |
| breakOnFailure | If true, an exception will be thrown when a monitoring query fails; leave null to keep current setting (default: false) |
| monitoringExpiration | If set, monitoring will automatically stop after the specified DateTime is reached |
| useCache | Whether to cache the IDs of the monitoring results to prevent duplicate fires (default: true) |
| bool Reddit.Controllers.PrivateMessages.MonitorSent | ( | int? | monitoringDelayMs = null, |
| int? | monitoringBaseDelayMs = null, |
||
| List< MonitoringSchedule > | schedule = null, |
||
| bool? | breakOnFailure = null, |
||
| DateTime? | monitoringExpiration = null, |
||
| bool | useCache = true |
||
| ) |
Monitor sent messages.
| monitoringDelayMs | The number of milliseconds between each monitoring query; leave null to auto-manage |
| monitoringBaseDelayMs | The number of milliseconds between each monitoring query PER THREAD (default: 1500) |
| schedule | A list of one or more timeframes during which monitoring of this object will occur (default: 24/7) |
| breakOnFailure | If true, an exception will be thrown when a monitoring query fails; leave null to keep current setting (default: false) |
| monitoringExpiration | If set, monitoring will automatically stop after the specified DateTime is reached |
| useCache | Whether to cache the IDs of the monitoring results to prevent duplicate fires (default: true) |
| bool Reddit.Controllers.PrivateMessages.MonitorUnread | ( | int? | monitoringDelayMs = null, |
| int? | monitoringBaseDelayMs = null, |
||
| List< MonitoringSchedule > | schedule = null, |
||
| bool? | breakOnFailure = null, |
||
| DateTime? | monitoringExpiration = null, |
||
| bool | useCache = true |
||
| ) |
Monitor unread messages.
| monitoringDelayMs | The number of milliseconds between each monitoring query; leave null to auto-manage |
| monitoringBaseDelayMs | The number of milliseconds between each monitoring query PER THREAD (default: 1500) |
| schedule | A list of one or more timeframes during which monitoring of this object will occur (default: 24/7) |
| breakOnFailure | If true, an exception will be thrown when a monitoring query fails; leave null to keep current setting (default: false) |
| monitoringExpiration | If set, monitoring will automatically stop after the specified DateTime is reached |
| useCache | Whether to cache the IDs of the monitoring results to prevent duplicate fires (default: true) |
|
protectedvirtual |
Invoke monitoring event for inbox.
| e | A valid MessagesUpdateEventArgs instance |
|
protectedvirtual |
Invoke monitoring event for sent.
| e | A valid MessagesUpdateEventArgs instance |
|
protectedvirtual |
Invoke monitoring event for unread.
| e | A valid MessagesUpdateEventArgs instance |
| bool Reddit.Controllers.PrivateMessages.PrivateMessagesInboxIsMonitored | ( | ) |
Whether inbox is being monitored.
| bool Reddit.Controllers.PrivateMessages.PrivateMessagesSentIsMonitored | ( | ) |
Whether sent is being monitored.
| bool Reddit.Controllers.PrivateMessages.PrivateMessagesUnreadIsMonitored | ( | ) |
Whether unread is being monitored.
| void Reddit.Controllers.PrivateMessages.ReadMessage | ( | string | ids | ) |
Mark a message as read.
| ids | A comma-separated list of thing fullnames |
| async Task Reddit.Controllers.PrivateMessages.ReadMessageAsync | ( | string | ids | ) |
Mark a message as read asynchronously.
| ids | A comma-separated list of thing fullnames |
| MessageContainer Reddit.Controllers.PrivateMessages.Reply | ( | LinksAndCommentsThingInput | linksAndCommentsThingInput | ) |
Reply to a private message.
| linksAndCommentsThingInput | A valid LinksAndCommentsThingInput instance |
| async Task<MessageContainer> Reddit.Controllers.PrivateMessages.ReplyAsync | ( | LinksAndCommentsThingInput | linksAndCommentsThingInput | ) |
Reply to a private message asynchronously.
| linksAndCommentsThingInput | A valid LinksAndCommentsThingInput instance |
|
protected |
Invoke the appropriate event for the given type.
| args | A valid MessagesUpdateEventArgs instance |
| type | One of: (inbox, unread, sent) |
| void Reddit.Controllers.PrivateMessages.UncollapseMessage | ( | string | ids | ) |
Uncollapse a message.
| ids | A comma-separated list of thing fullnames |
| async Task Reddit.Controllers.PrivateMessages.UncollapseMessageAsync | ( | string | ids | ) |
Uncollapse a message asynchronously.
| ids | A comma-separated list of thing fullnames |
| void Reddit.Controllers.PrivateMessages.UnreadMessage | ( | string | ids | ) |
Mark a message as unread.
| ids | A comma-separated list of thing fullnames |
| async Task Reddit.Controllers.PrivateMessages.UnreadMessageAsync | ( | string | ids | ) |
Mark a message as unread asynchronously.
| ids | A comma-separated list of thing fullnames |
|
get |
List of inbox messages.
|
get |
List of sent messages.
|
get |
List of unread messages.
| EventHandler<MessagesUpdateEventArgs> Reddit.Controllers.PrivateMessages.InboxUpdated |
Event handler for monitoring inbox.
| EventHandler<MessagesUpdateEventArgs> Reddit.Controllers.PrivateMessages.SentUpdated |
Event handler for monitoring sent.
| EventHandler<MessagesUpdateEventArgs> Reddit.Controllers.PrivateMessages.UnreadUpdated |
Event handler for monitoring unread.