overwolf.social.reddit API
Provides access to the Reddit social provider.
You can use overwolf.social.getDisabledServices()
method to check if the service is available.
Methods Reference
- overwolf.social.reddit.performUserLogin()
- overwolf.social.reddit.performLogout()
- overwolf.social.reddit.getUserInfo()
- overwolf.social.reddit.searchSubreddits()
- overwolf.social.reddit.share()
- overwolf.social.reddit.shareEx()
- overwolf.social.reddit.post()
- overwolf.social.reddit.cancelShare()
- overwolf.social.reddit.getSubredditFlairs()
Events Reference
Types Reference
- overwolf.social.reddit.RedditShareParameters Object
- overwolf.social.reddit.RedditPostParameters Object
- overwolf.social.reddit.SocialShareResult Object
- overwolf.social.reddit.SocialShareProgress Object
- overwolf.social.reddit.enums.ShareState Enum
- overwolf.social.reddit.Subreddit Object
- overwolf.social.reddit.RedditAllowedPostTypes Object
- overwolf.social.reddit.SearchSubredditsResult Object
- overwolf.social.reddit.ShareFailedEvent Object
- overwolf.social.reddit.LoginStateChangedEvent Object
performUserLogin()
Version added: 0.128
Opens the login dialog.
There is no callback for this method and the only way to know if the user signed in is via onLoginStateChanged event.
performLogout(callback)
Version added: 0.128
Performs a "strong" sign out of Reddit, so that even if the user performs a login via the Overwolf Settings / Accounts page, he will be considered signed out.
Parameter | Type | Description |
---|---|---|
callback | (Result) => void | A callback function which will be called with the status of the request |
getUserInfo(callback)
Version added: 0.128
If the user is currently logged into Reddit, this will return user information, Otherwise, an error is returned.
Parameter | Type | Description |
---|---|---|
callback | (Result: GetUserInfoResult) => void | A callback function which will be called with the status of the request |
searchSubreddits(query, callback)
Version added: 0.128
Search for subreddits whose names begin with a substring.
Parameter | Type | Description |
---|---|---|
query | string | The search string |
callback | (Result: SearchSubredditsResult) => void | Will contain an array of subreddits that match the search string |
share(RedditShareParameters, callback)
Version added: 0.128
If the user is currently logged into reddit, this will perform the video share.
Parameter | Type | Description |
---|---|---|
redditShareParameters | RedditShareParameters Object | The share parameters |
callback | (Result) => void | A callback function which will be called with the status of the request |
Types of errors that can occur:
- Disconnected (user isn't signed in)
- MissingFile (trying to share a missing file)
- UnsupportedFile (trying to share an unsupported format)
shareEx(RedditShareParameters, callback, callback)
Version added: 0.198
If the user is currently logged into Reddit, this will perform the video share.
Parameter | Type | Description |
---|---|---|
redditShareParams | RedditShareParameters Object | The share parameters |
resultCallback | (SocialShareResult) => void | A callback function which will be called with the resulting status of the request |
progressCallback | (socialShareProgress) => void | A callback function which will be called whenever share progress is made. See note |
Types of errors that can occur:
- Disconnected (user isn't signed in)
- MissingFile (trying to share a missing file)
- UnsupportedFile (trying to share an unsupported format)
Progress Note
This callback will only be called when uploading a video.
Videos will be uploaded in uniforamlly sized chunks (except for the last chunk). The callback will be called every time another chunk was successfully uploaded.
cancelShare(string, callback)
Version added: 0.198
cancels an ongoing share request with the given id, if valid. Callback will be invoked with success if such a request was found and a cancellation order was executed (may take a while)
Parameter | Type | Description |
---|---|---|
id | string | The request ID |
callback | (Result) => void | Called with the result of the cancellation |
overwolf.social.reddit.cancelShare("2", console.log)
post(RedditPostParameters, callback)
Version added: 0.203
If the user is currently logged into Reddit, this will perform the video share.
Parameter | Type | Description |
---|---|---|
redditShareParams | RedditPostParameters Object | The post parameters |
callback | (Result) => void | A callback function which will be called with the status of the request |
Types of errors that can occur:
- Disconnected (user isn't signed in)