#twitch #irc #async #asynchronous #tokio

twitchchat

interface to the irc-side of twitch’s chat system

89 releases (14 breaking)

0.14.8 Nov 2, 2020
0.14.5 Oct 16, 2020
0.11.8 Jul 4, 2020
0.9.3 Mar 30, 2020
0.3.0 Mar 26, 2019

#196 in Network programming

Download history 74/week @ 2021-02-26 62/week @ 2021-03-05 36/week @ 2021-03-12 317/week @ 2021-03-19 233/week @ 2021-03-26 236/week @ 2021-04-02 42/week @ 2021-04-09 165/week @ 2021-04-16 273/week @ 2021-04-23 150/week @ 2021-04-30 38/week @ 2021-05-07 132/week @ 2021-05-14 31/week @ 2021-05-21 38/week @ 2021-05-28 38/week @ 2021-06-04 150/week @ 2021-06-11

774 downloads per month
Used in 2 crates

MIT/Apache

405KB
10K SLoC

twitchchat

Documentation Crates Actions

This crate provides a way to interact with Twitch's chat.

Along with parse messages as Rust types, it provides methods for sending messages.

It also provides an 'event' loop which you can use to make a bot.

Opt-in features

By default, this crate depends on zero external crates -- but it makes it rather limited in scope. It can just parse/decode/encode to standard trait types (std::io::{Read, Write}).

To use the AsyncRunner (an async-event loop) you must able the async feature.

NOTE This is a breaking change from 0.12 which had the async stuff enabled by default.

twitchchat = { version = "0.14", features = ["async"] }

To use a specific TcpStream/TlStream refer to the runtime table below.

Serde support

To enable serde support, simply enable the optional serde feature

Runtime

This crate is runtime agonostic. To use..

Read/Write provider Features
async_io async-io
smol smol
async_std async-std
tokio tokio and tokio-util

TLS

If you want TLS supports, enable the above runtime and also enable the cooresponding features:

Read/Write provider Runtime Features TLS backend
async_io async_io "async-tls" rustls
smol smol "async-tls" rustls
async_std async_std "async-tls" rustls
tokio tokio "tokio-util", "tokio-rustls", "webpki-roots" rustls
tokio tokio "tokio-util", "tokio-native-tls", "native-tls" native-tls
tokio tokio "tokio-util", "tokio-openssl", "openssl" openssl

Examples

Using async_io to connect with..

Using async_std to connect with..

Using smol to connect with..

Using tokio to connect with..

How to use the crate as just a message parser(decoder)/encoder

An a simple example of how one could built a bot with this

License

twitchchat is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.

Dependencies

~0–4MB
~79K SLoC