Class: SugiliteIRC::TwitchMessage
Overview
Extra parsing for Twitch.tv’s uniqueness.
Instance Attribute Summary
Attributes inherited from Message
#command, #parameters, #prefix, #raw, #tags
Instance Method Summary collapse
-
#admin? ⇒ Boolean
Is the user an admin?.
-
#bits ⇒ Object
Get total bits in message if there are bits otherwise return empty value.
-
#broadcaster? ⇒ Boolean
Is the user a broadcaster?.
-
#color ⇒ Object
Get color of username in hex value if unset by user will return empty string.
-
#globalmod? ⇒ Boolean
Is the user a global moderator?.
-
#moderator? ⇒ Boolean
Is the user a moderator or broadcaster?.
-
#partner? ⇒ Boolean
Is the user a partner?.
-
#prime? ⇒ Boolean
Is the user a Twitch Prime user?.
-
#staff? ⇒ Boolean
Is the user a staff?.
-
#subscriber? ⇒ Boolean
Is the user a subscriber?.
-
#turbo? ⇒ Boolean
Is the user a Twitch Turbo user?.
-
#vip? ⇒ Boolean
Is the user a vip?.
Methods inherited from Message
#channel, #initialize, #message, #sender, #to_s
Constructor Details
This class inherits a constructor from SugiliteIRC::Message
Instance Method Details
#admin? ⇒ Boolean
Is the user an admin?
153 154 155 |
# File 'lib/sugiliteIRC.rb', line 153 def admin? ['badges'].include? 'admin' end |
#bits ⇒ Object
Get total bits in message if there are bits otherwise return empty value
113 114 115 |
# File 'lib/sugiliteIRC.rb', line 113 def bits ['bits'].to_i end |
#broadcaster? ⇒ Boolean
Is the user a broadcaster?
123 124 125 |
# File 'lib/sugiliteIRC.rb', line 123 def broadcaster? ['badges'].include? 'broadcaster' end |
#color ⇒ Object
Get color of username in hex value if unset by user will return empty string.
168 169 170 |
# File 'lib/sugiliteIRC.rb', line 168 def color ['color'] end |
#globalmod? ⇒ Boolean
Is the user a global moderator?
158 159 160 |
# File 'lib/sugiliteIRC.rb', line 158 def globalmod? ['badges'].include? 'global_mod' end |
#moderator? ⇒ Boolean
Is the user a moderator or broadcaster?
118 119 120 |
# File 'lib/sugiliteIRC.rb', line 118 def moderator? (['badges'].include? 'moderator') || broadcaster? end |
#partner? ⇒ Boolean
Is the user a partner?
143 144 145 |
# File 'lib/sugiliteIRC.rb', line 143 def partner? ['badges'].include? 'partner' end |
#prime? ⇒ Boolean
Is the user a Twitch Prime user?
138 139 140 |
# File 'lib/sugiliteIRC.rb', line 138 def prime? ['badges'].include? 'premium' end |
#staff? ⇒ Boolean
Is the user a staff?
163 164 165 |
# File 'lib/sugiliteIRC.rb', line 163 def staff? ['badges'].include? 'staff' end |
#subscriber? ⇒ Boolean
Is the user a subscriber?
128 129 130 |
# File 'lib/sugiliteIRC.rb', line 128 def subscriber? ['badges'].include? 'subscriber' end |
#turbo? ⇒ Boolean
Is the user a Twitch Turbo user?
133 134 135 |
# File 'lib/sugiliteIRC.rb', line 133 def turbo? ['badges'].include? 'turbo' end |
#vip? ⇒ Boolean
Is the user a vip?
148 149 150 |
# File 'lib/sugiliteIRC.rb', line 148 def vip? ['badges'].include? 'vip' end |