Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 1.23 KB

README.md

File metadata and controls

40 lines (31 loc) · 1.23 KB

Twitchie

Event driven Twitch IRC library written in .NET 5

MIT License

How to use it?

  1. Clone or download repository
  2. Build solution with Visual Studio
  3. Add built library to your project
  4. Obtain required chat oauth token. You can get it easily from here!
  5. Have fun

Example?

static async Task Main()
{
	// Initialize Twitchie instance, it will be disposed after ListenAsync ends.
	using var twitchie = new Twitchie();
	
	// Subscribe to events.
	twitchie.OnMessage += OnMessage;

	// Connect to Twitch IRC.
	await twitchie.ConnectAsync();
	
	// Login to Twitch IRC with lowercase username and OAuth token.
	await twitchie.LoginAsync(new("username", "oauth:password"));

	// Join some channel.
	await twitchie.JoinChannelAsync(new("#channel"));

	// Start loop which will receive messages until disposed/cancelled.
	await twitchie.ListenAsync();
}

static void OnMessage(object sender, MessageEventArgs e)
	=> Console.WriteLine($"User: {e.DisplayName} on channel: {e.Channel}: {e.Message}");

Dependencies

Twitchie doesn't use any external dependencies.