• Stars
    star
    103
  • Rank 333,046 (Top 7 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created almost 6 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

interface to the irc portion of Twitch's chat

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.

More Repositories

1

cargo-whatfeatures

a simple cargo plugin to get a list of features for a specific crate
Rust
75
star
2

mock_instant

a simple way to mock an std::time::Instant in a deterministic, thread-local way.
Rust
17
star
3

json_to_rust

generates Rust types from sample JSON
Rust
16
star
4

streamchat

the twitch chat thing extracted from shaken
Rust
12
star
5

twitch_message

Twitch message parsing in Rust
Rust
9
star
6

kappachat

chat with kappas near you
Rust
7
star
7

vohiyo

yet another twitch chat client
Rust
6
star
8

ccs

my `ccs` command, RIIR
Rust
6
star
9

shaken

shakespeare bot for my twitch chat.
Rust
6
star
10

aoc2021

"idiomatic" - some person
Rust
5
star
11

spotify-mistake

A song request bot and gui for my Twitch chat
Rust
5
star
12

smirc

more SMOrcs
Rust
4
star
13

diet-semicola

twitch bot, without semi-colons
Rust
4
star
14

what_stream

find twitch programming streams
Rust
4
star
15

pacing

like progress quest, but 2023
Rust
3
star
16

twitchlink

gets twitch stream links
Rust
3
star
17

alto_logger

an opinionated logger
Rust
3
star
18

readchat

a very simple alternative to 'streamchat'
Rust
3
star
19

viewers-rs

twitch viewer display, using gtk
Rust
3
star
20

vscode-settings

my VSC settings
3
star
21

comb

a mostly undocumented parser combinator library
Rust
2
star
22

pict

disappointment
Rust
2
star
23

brain

a markov "brain" that serves messages over http
Rust
2
star
24

museun-theme

a vscode theme
2
star
25

shuten

an opionated terminal drawing library
Rust
2
star
26

simple_env_load

a simple .env file loader
Rust
2
star
27

lexical_bool

LexicalBool allows treating arbitrary strings as bools
Rust
2
star
28

twitch-notify

A thing to show when a twitch stream is active
Rust
2
star
29

dust

show some info on file sizes
Rust
2
star
30

markings

an extremely simple template "language"
Rust
2
star
31

tinge

like touch(1)
Rust
2
star
32

mpv_drop

provides a drop target to generate mpv playlists, then sends them to dono-server
Rust
2
star
33

elegant

a Lisp-y thing
Rust
2
star
34

twitch_message_bot

a bot framework built ontop of github.com/museun/twitch_message
Rust
2
star
35

tee_readwrite

A set of Tee types (a Reader and a Writer). Useful for duplicating reads and writes for std::io::{Read, Write} types.
Rust
2
star
36

keypress

sends keypresses for a specific window over a websocket. what could go wrong.
Rust
2
star
37

egui_images

a cache that I use for fetching and loading images in egui
Rust
2
star
38

anachat

playing around with anathema
Rust
2
star
39

fuzzy

fuzzy searching, hard forked from https://github.com/jmaargh/fzyr
Rust
1
star
40

riirc

an irc client in Rust
Rust
1
star
41

reduce-target

finds, lists and removes directories named "target"
Rust
1
star
42

logos_iterator

a simple iterator for the logos crate
Rust
1
star
43

what_was_that

yet another spamming mistake
Rust
1
star
44

egui_search_window

a fuzzy search window for egui
Rust
1
star
45

twitchapi

work in progress
Rust
1
star
46

configurable

simple helpers for dealing with configurations
Rust
1
star
47

map_attr

just a small example showing a function attribute to make function inputs
Rust
1
star
48

harvey

perhaps, one day, this'll be a compiler and a language implementation
Rust
1
star
49

what_theme

tries to look up the current vscode theme and gets a link to it
Rust
1
star
50

shakey

a more shaky shaken
Rust
1
star
51

osk

on screen kappas
Rust
1
star
52

blaise

some pascal thing
Rust
1
star
53

png2sixel

a simple png to sixel thing
Rust
1
star
54

fsm

a set of traits, and derives for turning unit enums into finite state machines
Rust
1
star
55

neta

sort of like lox
Rust
1
star
56

noye

an irc bot
Rust
1
star
57

readchat2

sequel to readchat, this time with a nice-ish interface
Rust
1
star
58

oops

"jvm" without semi-colons
Rust
1
star
59

one_or_many

a type that stores 0, 1 or many instances of a type, and provides `IntoIterator` for it
Rust
1
star
60

twitch_mediated

danmaku for twitch chat using egui
Rust
1
star
61

phf

derive a perfect hash function for an enum
Rust
1
star
62

molpe

a distraction
Rust
1
star
63

md2

md2 parser
Rust
1
star
64

rcc

perhaps a C to AMD64 asm compiler
Rust
1
star
65

template

a simple template thing using derives and enums
Rust
1
star
66

measure

like time(1), but for windows and likely simpler.
Rust
1
star
67

debug_iterator

an iterator adapter to simply print out the fmt::Debug representation of the item, optionally sends it to log::debug!
Rust
1
star
68

persist

simple serde abstraction
Rust
1
star
69

a-mistake

this is a mistake
Rust
1
star
70

torch

a less like pager to demo `shuten`
Rust
1
star
71

dono_server

this logs youtube and locally played songs
Rust
1
star