README.md in twitch-bot-2.1.1 vs README.md in twitch-bot-3.1.0
- old
+ new
@@ -1,13 +1,11 @@
# Twitch::Bot
`twitch-bot` provides a Twitch chat client object that can be used for building Twitch chat bots.
-This gem is based on the `twitch-chat` gem by https://github.com/EnotPoloskun.
+This gem is based on [`twitch-chat`](https://github.com/EnotPoloskun/twitch-chat).
-_As of April 2020, this gem is under heavy development. I've created it to develop my own Twitch chat bot and will add more functionality. Feel free to add issues with suggestions and feature requests!_
-
## Installation
Add this line to your application's `Gemfile`:
```ruby
@@ -26,60 +24,10 @@
$ gem install twitch-bot
```
## Usage
-```ruby
-require "twitch/bot"
-
-class JoinHandler < Twitch::Bot::EventHandler
- def call
- client.send_message "Hi guys!"
- end
-
- def self.handled_events
- [:join]
- end
-end
-
-class SubscriptionHandler < Twitch::Bot::EventHandler
- def call
- client.send_message "Hi #{event.user}, thank you for your subscription"
- end
-
- def self.handled_events
- [:subscription]
- end
-end
-
-class TimeCommandHandler < Twitch::Bot::EventHandler
- def call
- if event.bot_command?("time")
- client.send_message "Current time: #{Time.now.utc}"
- end
- end
-
- def self.handled_events
- [:chat_message]
- end
-end
-
-connection = Twitch::Bot::Connection.new(
- nickname: "test",
- password: "secret",
-)
-
-client = Twitch::Bot::Client.new(
- connection: connection,
- channel: "test",
-) do
- register_handler(JoinHandler)
- register_handler(SubscriptionHandler)
- register_handler(TimeCommandHandler)
-end
-
-client.run
-```
+Refer to the [Teneggs](https://www.github.com/geewiz/teneggs) repository for an example bot implementation.
## Supported event types
* ``:authenticated``
* ``:join``