class Twitchbot::AuthPlugin

Plugin to handle authenticating the bot account and authorizing the use of all available Twitch IRCv3 capabilities

Constants

CAPABILITIES

The capabilities available to request

Public Instance Methods

open(handler) click to toggle source

Send bot account credentials after the connection has opened

# File lib/twitchbot/plugin/auth_plugin.rb, line 17
def open(handler)
  handler.send_raw "PASS #{handler.bot.password}"
  handler.send_raw "NICK #{handler.bot.username}"
end
request_caps(handler) click to toggle source

Listen for the last message of a successful authentication attempt and request capabilities

> :tmi.twitch.tv 001 bot :Welcome, GLHF!
> :tmi.twitch.tv 002 bot :Your host is tmi.twitch.tv
> :tmi.twitch.tv 003 bot :This server is rather new
> :tmi.twitch.tv 004 bot :-
> :tmi.twitch.tv 375 bot :-
> :tmi.twitch.tv 372 bot :You are in a maze of twisty passages, all alike.
> :tmi.twitch.tv 376 bot :>
# File lib/twitchbot/plugin/auth_plugin.rb, line 33
def request_caps(handler)
  handler.send_raw "CAP REQ :#{CAPABILITIES.join ' '}"
end