Class: Twitchbot::PingPlugin

Inherits:
Object
  • Object
show all
Includes:
Plugin
Defined in:
lib/twitchbot/plugin/ping_plugin.rb

Overview

Plugin to handle any PING messages from the server and keep the connection alive

Constant Summary

Constants included from Plugin

Twitchbot::Plugin::COMMANDS

Instance Method Summary collapse

Methods included from Plugin

#close, #error, included, #open

Instance Method Details

#message(handler) ⇒ Object

Listen for any PING messages and respond with PONG

> PING :tmi.twitch.tv


12
13
14
# File 'lib/twitchbot/plugin/ping_plugin.rb', line 12

def message(handler)
  handler.send_raw('PONG :tmi.twitch.tv') if handler.message.ping?
end