overwolf.social.reddit

Provides access to the Reddit social provider.

Note: you can use overwolf.social.getDisabledServices() method to check if the service is available.

Methods

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: callback <function>

Callback argument:
On success: { status: "success" }
On failure: { status: "error", reason: [description] }

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: callback <function>

Callback argument:
{ userInfo: { avatar: "http://abs.twimg.com/sticky/...", displayName: "u/foobar", name: "foobar" }}

searchSubreddits(query, callback)

Version added: 0.128

Search for subreddits whose names begin with a substring.

  • Parameter: query <string>

    The search string.

  • Parameter: callback <function>

    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 YouTube, this will perform the video share.

Callback argument:
// type 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)

Events How to use events

onLoginStateChanged

Version added: 0.128

Fired when the user’s login state changes. 

Event value:
{ state = "connected" }{ state = "disconnected" }

onShareFailed

Version added: 0.128

Fired when an error is returned from Reddit.

Event value:
Currently, supported errors are:

{ error: "NotFound", details: "that subreddit doesn't exist" }

{ error: "RateLimit", details: "you are doing that too much. try again in 7 minutes." }

Types

overwolf.social.reddit.RedditShareParameters

Options

file

<string>

The file to share.

subreddit

<string>

The subreddit to which the file will be shared.

description

<string>

The shared video's description.

trimming

<VideoCompositionSegment[]> — Optional

An object containing start time and end time for the desired videosegment.

tags

<string> — Optional

An array of chronological events that occurred during the capture.

gameClassId

<int> — Optional

The associated game's class ID.

gameTitle

<string> — Optional

The associated game's title.

metadata

<object> — Optional

Extra information about the game session.