Skip to content

Latest commit

 

History

History
37 lines (20 loc) · 891 Bytes

File metadata and controls

37 lines (20 loc) · 891 Bytes

Simple Login

Author

Kris Craig

Required libraries

Overview

This demonstrates how to login to the Reddit API via OAuth. This assumes you already have an access token and refresh token. If not, you can checkout this video or consult Reddit's docs for assistance.

Library Installation

In the NuGet Package Manager console:

Install-Package Reddit

The Code

using Reddit;

...

var reddit = new RedditClient("YourRedditAppID", "YourBotUserRefreshToken");

Console.WriteLine("Username: " + reddit.Account.Me.Name);

Console.WriteLine("Cake Day: " + reddit.Account.Me.Created.ToString("D"));

Source File

Simple Login.cs