[][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 a Writer

eventsfeature="tokio"

Available event filters.

messages

Messages sent by the server

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.

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

Runner

The runner is the main "event loop" of this crate.

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

Functions

connect

Opens an async TCP connection using the provided UserConfig.

connect_easy

Opens an async TCP connection using the provided name, token.

connect_easy_tlsfeature="tokio_native_tls" or feature="tokio_rustls"

Opens an async TCP connection with TLS using the provided name, token.

connect_tlsfeature="tokio_native_tls" or feature="tokio_rustls"

Opens an async TCP connection with 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

Type Definitions

BadgeInfo

Metadata to the chat badges

Writer

A writer that allows sending messages to the client