Twitcher 0.1.1
dotnet add package Twitcher --version 0.1.1
NuGet\Install-Package Twitcher -Version 0.1.1
<PackageReference Include="Twitcher" Version="0.1.1" />
paket add Twitcher --version 0.1.1
#r "nuget: Twitcher, 0.1.1"
// Install Twitcher as a Cake Addin
#addin nuget:?package=Twitcher&version=0.1.1
// Install Twitcher as a Cake Tool
#tool nuget:?package=Twitcher&version=0.1.1
<p align="center"> <img src="https://github.com/LiphiTC/Twitcher/blob/master/Images/icon.png" style="max-height: 300px;"> </p>
Twitcher is a C# library based on TwitchLib with some features
Usage
To create TwitcherClient you have to use TwitchLib ConnectionCredentials
TwitcherClient client = new TwitcherClient()
.UseTwitchLibProvider(new ConnectionCredentials("liphitc", "somerandomnotrealtoken"))
Then you can JoinChannels
client.JoinChannel("LiphiTC");
or
client.JoinChannels(new string[] { "LiphiTC", "pajaDank" } );
And Connect Bot
client.Connect();
Controllers
One of the feature of Twitcher is Controller
To Use Controllers
ControllerBuilder builder = client.UseControllers();
It will сreate instance of ControllerBuilder
To Build it
builder.BuildControllers();
Then you can create a controller class
public class TestController : Controller
{
[Same("WoahBlanket")]
public void TestController() {
Send("WoahBlanket");
}
}
Attributes for controllers and controller methods:
[Vip]
[Mod]
[Subscriber]
[Subscriber(int)] Min Subscriber Mounth
[User(string)] User, allowed to use this controller. "any" for all users. By default "any"
[Channel(string)] Channel, where controller can be used. "any" for all connected channels. By default "any"
Also, for methods you can use:
[NonCommand]
[StartWith(string, RegisterCheck(bool), IsFullWord(bool))]
[Contains(string, RegisterCheck(bool))]
[Same(string, RegisterCheck(bool))]
[Single]
By default all methods of all matching controllers will be executed
If you want only a specific method to be called add [Single]\
Controller has 2 Methods: Send(string) and SendAnswer(string message)
and 2 Properties: Message and Client
Controller Services
Controller services are provided as parameters to the controller constructor
To create your service create Factory, Service class and Service Settings
Example Factory:
public class ExampleServicerFactory : IServiceFactory<ExampleService, ExampleServiceSettings>
{
public ExampleService ServiceFactory(ExampleServiceSettings settings, TwitcherClient client, ChatMessage message)
{
return new ExampleService();
}
}
Then you can register service in ControllerBuilder
builder.RegisterService<ExampleService, ExampleServiceSettings, ExampleServiceSettings>(new ExampleServiceSettings());
And use it in controller
public class TestController : Controller
{
public TestController(ExampleService service)
{
}
}
Json Helper
Project uses
TwitchLib Config .NET Newtonsoft.Json
License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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 was computed. 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. |
-
net5.0
- Newtonsoft.Json (>= 13.0.1)
- TwitchLib (>= 3.2.0)
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 |
---|