blob: 88c1221ee87fa1ca1c0b222003bae4928b34e563 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# twitch
A binding to the [Twitch API](https://dev.twitch.tv/docs) implemented in [Crystal](https://crystal-lang.org/).
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
twitch:
github: y32/twitch
```
## Usage
There are several main components to the library:
- `Twitch::Kraken` - Client for interacting with Twitch's REST API
```crystal
require "twitch/kraken"
twitch = Twitch::Kraken.new(token: "cfabdegwdoklmawdzdo98xt2fo512y")
```
Refer to the documentation for the kinds of requests you can make with this client.
- `Twitch::IRC` - Client for building IRC applications
```crystal
require "twitch/irc"
bot = Twitch::IRC.new(nick: "nekka", token: "cfabdegwdoklmawdzdo98xt2fo512y")
# Create a handler to process incoming messages
bot.on_message do |message|
# handle this message
end
# Connect to Twitch
bot.run!
```
## Contributors
- [Daniel-Worral](https://github.com/Daniel-Worrall) - creator, maintainer, spec-man extraordinaire
- [snapcase](https://github.com/snapcase) - creator, maintainer, IRC expert
- [z64](https://github.com/z64) - creator, maintainer, script kiddie
|