MiniTwitch.Helix 0.4.2-prerelease

This is a prerelease version of MiniTwitch.Helix.
dotnet add package MiniTwitch.Helix --version 0.4.2-prerelease                
NuGet\Install-Package MiniTwitch.Helix -Version 0.4.2-prerelease                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MiniTwitch.Helix" Version="0.4.2-prerelease" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MiniTwitch.Helix --version 0.4.2-prerelease                
#r "nuget: MiniTwitch.Helix, 0.4.2-prerelease"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MiniTwitch.Helix as a Cake Addin
#addin nuget:?package=MiniTwitch.Helix&version=0.4.2-prerelease&prerelease

// Install MiniTwitch.Helix as a Cake Tool
#tool nuget:?package=MiniTwitch.Helix&version=0.4.2-prerelease&prerelease                

MiniTwitch.Helix (Pre-release)

MiniTwitch.Helix conveniently wraps the Twitch Helix API and exposes them through the HelixWrapperclass.

Features

  • Contains all generally available and beta Helix API endpoints

  • Virtually no dependencies

  • Returns meaningful information about responses with HelixResult:

    • HelixResult.Success: Whether the request was successful
    • HelixResult.StatusCode: Status code of the response
    • HelixResult.Message: Contains the error message for the request, if not successful
    • HelixResult.Elapsed: The amount of time the request took to get a response
    • HelixResult.RateLimit.Limit: Maximum amount of requests that can be made in a period
    • HelixResult.RateLimit.Remaining: The amount of requests that can be made before the ratelimit resets
    • HelixResult.RateLimit.ResetsIn: The amount of time before the ratelimit resets
  • Validates access tokens & warns before their expiry

  • Easy pagination API for HelixResult<T>:

    • HelixResult.CanPaginate: Determines whether the next page of content can be requested
    • HelixResult.Paginate(): Fetches the next page of content

Getting Started

This example demonstrates the usage of HelixWrapper and pagination through HelixResult<T>

using MiniTwitch.Helix;
using MiniTwitch.Helix.Models;
using MiniTwitch.Helix.Responses;

namespace MiniTwitchExample;

public class Program
{
    public static HelixWrapper Helix { get; set; }

    static async Task Main()
    {
        Helix = new HelixWrapper("wjm4xzd5fxp4ilaykzmmwc3dett9vm", 783267696);

        var emotes = await GetAllMyEmotes();
    }

    private static async Task<List<string>> GetAllMyEmotes()
    {
        HelixResult<UserEmotes> emotesResult = await Helix.GetUserEmotes();
        if (!emotesResult.Success)
        {
            return [];
        }

        List<string> emoteList = [];
        foreach (var emote in emotesResult.Value.Data)
        {
            emoteList.Add(emote.Name);
        }

        // Fetch the next pages of content.
        // The code inside will not run if there are no more pages.
        await foreach (var nextEmotesResult in emotesResult.EnumeratePages())
        {
            foreach (var emote in nextEmotesResult.Value.Data)
            {
                emoteList.Add(emote.Name);
            }
        }

        return emoteList;
    }
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.4.2-prerelease 29 8/5/2024
0.4.1-prerelease 112 7/12/2024
0.4.0-prerelease 36 7/11/2024
0.3.1-prerelease 116 4/26/2024
0.3.0-prerelease 61 4/24/2024
0.2.3-prerelease 81 1/27/2024
0.2.2-prerelease 99 1/10/2024
0.2.1-prerelease 148 11/14/2023
0.2.0-prerelease 75 11/6/2023
0.1.0-prerelease 74 11/1/2023

This changelog is available at: https://github.com/Foretack/MiniTwitch/blob/master/MiniTwitch.Helix/CHANGELOG.md

# MiniTwitch.Helix Changelog

## 0.4.2-prerelease

### Minor Changes
- Added IAsyncEnumerable pagination API `HelixResult<T>.EnumeratePages()` (#122)
- Added links to the API reference page for every call (#120)

### Fixes
- Fixed getting 0 as the ChannelId for followed channels (#123)
- Fixed deserialization exception in `GetBannedUsers()` (#121)

## 0.4.1-prerelease

### Fixes
-  Fix getting JsonException when a result without value is a success (#119)

****

## 0.4.0-prerelease

### Breaking changes
- `SortedHelixWrapper` has been removed (#110)

### Minor Changes
- Changing the token of `HelixWrapper` is now possible through `HelixWrapper.Client.ChangeToken()` (#110)
- Added `Warn Chat User` endpoint (#111)
- Error messages are now provided from Helix responses rather than scraped data (#115)

### Fixes
- Fixed an exception that occurs when empty strings are provided to SnakeCase.ConvertToCase
- Fixed an exception that occurs when calling `GetChatSettings()` on a channel that does not have any special modes enabled
- The HttpResponseMessage from making calls with HttpClient now gets disposed (#118)

****

## 0.3.0-prerelease

### Minor changes
- Added `Get User Emotes` endpoint (#83)
- Added Conduit endpoints (#87)
- Added `Get Unban Requests` endpoint (#91)
- Added `Resolve Unban Requests` endpoint (#93)

### Fixes
- Fixed NullReferenceException when attempting to validate certain token types

### Development changes
- Updated naming policy used for (de)serialization

****

## 0.2.3-prerelease

### Minor changes

- Added "Send Chat Message" endpoint

****

## 0.2.2-prerelease

### Minor changes

- Added "Get Moderated Channels" endpoint
- Added a semaphore lock to token validation to ensure consistency

### Fixes

- [Updated "Get Ad Schedule" response](https://dev.twitch.tv/docs/change-log/#:~:text=2023%E2%80%9112%E2%80%9111)