Class: Twitch::Bot::Client::PingHandler

Inherits:
EventHandler show all
Defined in:
lib/twitch/bot/default_handlers.rb

Overview

Respond to a :ping event with a pong so we don’t get disconnected.

Instance Attribute Summary

Attributes inherited from EventHandler

#client, #event

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from EventHandler

#initialize

Constructor Details

This class inherits a constructor from Twitch::Bot::EventHandler

Class Method Details

.handled_eventsObject



13
14
15
# File 'lib/twitch/bot/default_handlers.rb', line 13

def self.handled_events
  [:ping]
end

Instance Method Details

#callObject



9
10
11
# File 'lib/twitch/bot/default_handlers.rb', line 9

def call
  client.send_data "PONG :#{event.hostname}"
end