Class: Twitch::Bot::PrivMsgCommandParser
- Inherits:
-
CommandParser
- Object
- CommandParser
- Twitch::Bot::PrivMsgCommandParser
- Defined in:
- lib/twitch/bot/message_parser.rb
Overview
Parses a PRIVMSG IRC command
Instance Attribute Summary
Attributes inherited from CommandParser
Instance Method Summary collapse
Methods inherited from CommandParser
Constructor Details
This class inherits a constructor from Twitch::Bot::CommandParser
Instance Method Details
#call ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/twitch/bot/message_parser.rb', line 56 def call user = .user text = .text if user == "twitchnotify" if text.match?(/just subscribed!/) Message::Subscription.new( user: .params.last.split(" ").first, ) else Message::NotSupported.new() end else Message::UserMessage.new(text: text, user: user) end end |