Skip to content
/ Msky Public

Misskey library for .NET Standard 2.0, Under development yet.

License

Notifications You must be signed in to change notification settings

mei23/Msky

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Msky

Misskey library for .NET Standard 2.0

Under development yet.

Usage

Authentication / Authorization

Method1: No Authentication. For use API as anonymous.

var misskey = new Misskey("https://misskey.example.com");

Method2: Authenticate with predefined API key, or past authorized API key.

var misskey = new Misskey("https://misskey.example.com", "API Key");

Method3: Authenticate/Authorize by Authorize feature

var misskey = new Misskey("https://misskey.example.com");

AuthSession session = await misskey.Auth.Session.GenerateAsync("App's secret key");

Console.WriteLine("Open URL: {0}", session.Url);
try { System.Diagnostics.Process.Start(session.Url); }  // Fail on .NET Core
catch { Console.WriteLine("Failed to open url. Please manually open it."); }

Console.WriteLine("Please authorize in your browser, then push Enter.");
Console.ReadLine();

UserKey userkey = await misskey.Auth.Session.UserkeyAsync(appSecret, session.Token);

string apiKey = misskey.UpdateApiKey(userkey.AccessToken, appSecret);
// This apikey may use on method2.

API example

Get server meta data

Meta meta = await misskey.MetaAsync();
Console.WriteLine(string.Format("Version: {0}", meta.Version));
Console.WriteLine(string.Format("ClientVersion: {0}", meta.ClientVersion));

Posting

await misskey.Notes.CreateAsync("Note text");

About

Misskey library for .NET Standard 2.0, Under development yet.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages