[][src]Crate twitchchat

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

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

Demonstration

See examples/demo.rs for a demo of the api


Here's a quick link to the Event Mapping

Modules

color

Color types associated with Twitch.

decode

Decode messages from a &str

encode

Encode data to an std::io::Write or tokio::io::AsyncWrite

events

Available event filters.

messages

Messages sent by the server

native_tls

tokio-native-tls connector for using a TLS connection with Twitch.

rate_limitfeature="tokio"

A simple leaky-bucket style token-based rate limiter

sync

Synchronous methods

twitch

Common Twitch types

Structs

Badge

Badges attached to a message

Channel

Simple channel wrapper.

Connector

A connector type that acts as a factory for connecting to Twitch

Control

A control type for writing messages to the client, or stopping it.

Dispatcher

An event dispatcher

Emotes

Emotes are little pictograms used in-line in Twitch messages

Encoder

An encoder for messages

EventStream

A Stream that produces an item

MpscWriter

A tokio mpsc based writer

RateLimit

A leaky-bucket style token-based rate limiter

RetryStrategy

Some common retry strategies.

Runner

A type that drive the event loop to completion, and optionally retries on an return condition.

Tags

Tags are IRCv3 message tags. Twitch uses them extensively.

UserConfig

User configuration for 'registering' with Twitch

UserConfigBuilder

Builder for making a UserConfig

Enums

BadgeKind

The kind of the badges that are associated with messages.

Capability

Capability used to enable extra functionality with the protocol

ChannelError

An error produced by invalid channel names

Error

An error returned by this crate

Status

Status of the client after running

UserConfigError

User config error returned by the UserConfigBuilder

Constants

ANONYMOUS_LOGIN

An anonymous login.

TWITCH_IRC_ADDRESS

The Twitch IRC address for non-TLS connections

TWITCH_IRC_ADDRESS_TLS

The Twitch IRC address for TLS connections

TWITCH_WS_ADDRESS

The Twitch WebSocket address for non-TLS connections

TWITCH_WS_ADDRESS_TLS

The Twitch WebSocket address for TLS connections

Traits

AsOwned

Converts a type to an owned version

IntoChannel

A trait to convert types into Channel

Parse

A trait for parsing messages

Reborrow

Helper to reborrow a Cow without moving it

Functions

connect_easy_no_tls

Connect to Twitch without TLS. Using the provided name, token.

connect_no_tls

Connect to Twitch without TLS. Using the provided UserConfig.

decode

Tries to decode potentially many messages from this input string

decode_one

Tries to decode one message, returning the amount of remaining data in the input

register

Write the provided UserConfig to the async writer

register_easy

Write the provided name and token to the async writer

Type Definitions

BadgeInfo

Metadata to the chat badges

Writer

A writer that allows sending messages to the client