Class: SugiliteIRC::TwitchMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/sugiliteIRC.rb

Overview

Extra parsing for Twitch.tv’s uniqueness.

Instance Attribute Summary

Attributes inherited from Message

#command, #parameters, #prefix, #raw, #tags

Instance Method Summary collapse

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?

Returns:

  • (Boolean)


153
154
155
# File 'lib/sugiliteIRC.rb', line 153

def admin?
  @tags['badges'].include? 'admin'
end

#bitsObject

Get total bits in message if there are bits otherwise return empty value



113
114
115
# File 'lib/sugiliteIRC.rb', line 113

def bits
  @tags['bits'].to_i
end

#broadcaster?Boolean

Is the user a broadcaster?

Returns:

  • (Boolean)


123
124
125
# File 'lib/sugiliteIRC.rb', line 123

def broadcaster?
  @tags['badges'].include? 'broadcaster'
end

#colorObject

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
  @tags['color']
end

#globalmod?Boolean

Is the user a global moderator?

Returns:

  • (Boolean)


158
159
160
# File 'lib/sugiliteIRC.rb', line 158

def globalmod?
  @tags['badges'].include? 'global_mod'
end

#moderator?Boolean

Is the user a moderator or broadcaster?

Returns:

  • (Boolean)


118
119
120
# File 'lib/sugiliteIRC.rb', line 118

def moderator?
  (@tags['badges'].include? 'moderator') || broadcaster?
end

#partner?Boolean

Is the user a partner?

Returns:

  • (Boolean)


143
144
145
# File 'lib/sugiliteIRC.rb', line 143

def partner?
  @tags['badges'].include? 'partner'
end

#prime?Boolean

Is the user a Twitch Prime user?

Returns:

  • (Boolean)


138
139
140
# File 'lib/sugiliteIRC.rb', line 138

def prime?
  @tags['badges'].include? 'premium'
end

#staff?Boolean

Is the user a staff?

Returns:

  • (Boolean)


163
164
165
# File 'lib/sugiliteIRC.rb', line 163

def staff?
  @tags['badges'].include? 'staff'
end

#subscriber?Boolean

Is the user a subscriber?

Returns:

  • (Boolean)


128
129
130
# File 'lib/sugiliteIRC.rb', line 128

def subscriber?
  @tags['badges'].include? 'subscriber'
end

#turbo?Boolean

Is the user a Twitch Turbo user?

Returns:

  • (Boolean)


133
134
135
# File 'lib/sugiliteIRC.rb', line 133

def turbo?
  @tags['badges'].include? 'turbo'
end

#vip?Boolean

Is the user a vip?

Returns:

  • (Boolean)


148
149
150
# File 'lib/sugiliteIRC.rb', line 148

def vip?
  @tags['badges'].include? 'vip'
end