Skip to content

.NET library to interact with with catgirls

License

Notifications You must be signed in to change notification settings

Nekos-life/Nekos.Net

Repository files navigation

🎉 Welcome to Nekos.Net repository

"A project made for nekos" - Swyrin

GH_UserCount NG_LatestVersion NG_DLCount Discord_MemberCount

Nekos.Net is an asynchronous library to interact with nekos.life API, currently supporting both v2 and v3 API. If you love this repo, consider giving it a star ⭐

❓ How to use

Version 2

namespace Hello.There.Nekos;

public class Program
{
    public async Task ExecuteMeAsync()
    {
        NekosV2Client client = new();
        NekoOwoify owo = await client.OwOifyAsync("Hello world");
        Console.WriteLine(owo.OwO);
    }
}

Version 3

⚠️ This API version is still in development phase by the owners so this code snippet might change in the future

namespace Hello.There.Nekos;

public class Program
{
    public async Task ExecuteMeAsync()
    {
        NekosV3Client client = new();
        NekosSingleResponse res = await client.WithSfwImgEndpoint(SfwImgEndpoint.Neko).GetAsync();
        Console.WriteLine(res.Data.Response.Url);
    }
}

With logging (+Serilog)

namespace Hello.There.Nekos;

public class Program
{
    private NekosV2Client _clientWithLogging;

    public void CreateAClientWithLogger()
    {
        Log.Logger = new LoggerConfiguration()
            .MinimumLevel.Debug()
            .WriteTo.Console()
            .CreateLogger();
            
        _clientWithLogging = new(new SerilogLoggerProvider(Log.Logger).CreateLogger("Nekos"));        
    }
}

Want to join us?