Home Developers Examples & updates
Category:

Examples & updates

Examples how to use our tools.

  • Authenticate as a user to use the API

    by BlushyFace
    by BlushyFace 44 views

    In this example we authenticate as a user and call a couple API (Helix) endpoints to get the user follower list and stream key. First we wait for a user to authenticate and when successful we call the GetUserFollowsAsync() and GetStreamKeyAsync() methods to get the data from the Twitch API. using System; using System.Collections.Generic; using BlushyFace.Twitch.API.Helix; using BlushyFace.Twitch.Authentication.Enums; namespace BlushyFace.Twitch.Tester.Tests { public class Api { private Authentication _auth; public Api() { Run(); } public void Run() { _auth = new Authentication(new[] { “http://+:8081/” }); var scopes = new List<Enum>() { Scope.Helix.UserReadEmail, // Scope.Helix.ChannelReadStreamKey, }; _auth.OAuth.OpenBrowserAuthorizationFlow(scopes: scopes, addState: false, forceVerify: false);…

    0 FacebookTwitterPinterestReddit
  • Authenticate as user and connect to Twitch chat

    by BlushyFace
    by BlushyFace 66 views

    Previously we wrote an auth lib that takes care of authenticating users (blog.blushyface.com/2020/09/30/developers/examples/quick-guide-blushyface-twitch-authentication/) and now we use that example to authenticate users to connect to Twitch chat. To start out we will be creating a new Authentication instance (that already has the correct settings (client id / client secret / redirect URL) and runs a local web server) while adding a couple scopes so we can do chat things (read/send/whisper), after that we open a browser where we ask the user to authenticate themselves. The application listens for auth events and when the user is successfully authenticated it will automatically…

    0 FacebookTwitterPinterestReddit
  • BlushyFace.Twitch.Authentication scopes added

    by BlushyFace
    by BlushyFace 64 views

    [Update #2] Changed Enums.x.y to Scope.x.y; and moved it to the Enums namespace. I should probably have waited writing this post until done making changes for the day. [Update] Went ahead and changed the scopes to Enums. Everything else is the same but looks a bit more cleaner than previously. [Original] Updated BlushyFace.Twitch.Authentication to include scopes based on github.com/BarryCarlyon/twitch_misc/blob/master/authentication/user_access_generator/scopes.json by Barry Carlyon. This should make it more clear when adding (multiple) scopes instead of writing them manually which can be prone to errors. Before OAuth.OpenBrowserImplicitFlow(scopes: “chat:edit+chat:read+whispers:edit+user:read:email”); OAuth.OpenBrowserAuthorizationFlow(scopes: “user:read:email”); After var scopes = new Scopes(); scopes.Helix.AddAnalyticsReadExtensions(); scopes.Helix.AddBitsRead(); scopes.Helix.AddModerationRead(); scopes.Drops.AddViewingActivityRead(); scopes.Chat.AddChatEdit(); scopes.Chat.AddChatRead();…

    0 FacebookTwitterPinterestReddit
  • [Quick guide] BlushyFace.Twitch.Authentication

    by BlushyFace
    by BlushyFace 67 views

    [Update] Added support for optional states that is managed inside the lib and renamed some methods so it’s more clear what they do but it is not updated in the [original] post below.   [Original] General BlushyFace.Twitch.Authentication is a lightweight C# .NET Core library that makes it easy to authenticate Twitch users using OAuth (OIDC not implemented as I have no real use for it). A valid token (+ required scope(s)) is required to use the various endpoints provided in BlushyFace.Twitch.API and various chat features in BlushyFace.Twitch.Chat The BlushyFace.Twitch.Authentication lib looks like this: Available methods OAuth.OpenBrowserImplicitFlow(…); // opens a browser…

    0 FacebookTwitterPinterestReddit
  • Chat v2 updated message tags

    by BlushyFace
    by BlushyFace 49 views

    Updated the message tags for various IRC commands to return proper data types. The old way to get the message tag values was to manually parse each tag individually for example when someone subscribes a USERNOTICE event gets fired and to get the streak months and sub plan you could either get it from the system message ( x.GetTagValue(“system-msg”) ) or individual tags x.GetTagValue(“msg-param-streak-months”) and x.GetTagValue(“msg-param-sub-plan”). This was not ideal so to do this now follow the example below.

    0 FacebookTwitterPinterestReddit
  • Connect to Twitch chat with multiple clients

    by BlushyFace
    by BlushyFace 49 views

    Started rewriting BlushyFace.Twitch.Chat into BlushyFace.Twitch.Chat.V2 because while v1 is a rewrite ported from my .NET FX version I wasn’t totally happy with it and decided to just rewrite it in it’s entirely. This is a work in progress but the basic client is fully functional. The client features are based on what I need so if you have suggestions what you would like me to add let me know with a comment below or join our discord. The example shows how to create multiple clients, client is a user that is logged in to chat and able to receive &…

    0 FacebookTwitterPinterestReddit
  • Twitch lib updated to .NET Core

    by BlushyFace
    by BlushyFace 200 views

    This is an updated version / rewrite of my Twitch library from the .NET Framework to .NET Core with the purpose to move over my other Twitch related tools to the latest and greatest. At the moment Twitch chat functionality is supported and support for the Twitch API (Kraken v5 & Helix) will be added as well once the chat part is fully done and tested. Note that this is a work in progress so if you encounter any issues feel free to let me know so I can fix it. That said, there aren’t really any new fancy features…

    0 FacebookTwitterPinterestReddit
  • Setting up the client and using chat commands

    by BlushyFace
    by BlushyFace 289 views

    General To use the library you need to add it as reference in your project. This guide covers connecting to the Twitch chat and sending a message to chat as bot / broadcaster etc and will not go into other features the library provides. It also does not cover everything such as the various available Twitch chat commands but by following the command examples below you should be able use the rest by checking what it requires.

    0 FacebookTwitterPinterestReddit

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

LIVE NOW! CLICK TO VIEW.
CURRENTLY OFFLINE