Class: Twitch::Bot::ModeCommandParser

Inherits:
CommandParser show all
Defined in:
lib/twitch/bot/message_parser.rb

Overview

Parses a MODE IRC command

Constant Summary collapse

MODE_CHANGE =
{
  "-o" => :remove_moderator,
  "+o" => :add_moderator,
}.freeze

Instance Attribute Summary

Attributes inherited from CommandParser

#message

Instance Method Summary collapse

Methods inherited from CommandParser

#initialize

Constructor Details

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

Instance Method Details

#callObject



80
81
82
83
# File 'lib/twitch/bot/message_parser.rb', line 80

def call
  params = message.params
  Message::Mode.new(user: params.last, mode: MODE_CHANGE[params[1]])
end