Module: Lobstersbot::Salute
- Defined in:
- lib/lobstersbot/plugins/salute.rb
Constant Summary collapse
- @@claws =
['(V)', '(\\/)', '(\\_/)', 'V', 'v', '(v)']
- @@faces =
['_!_!_', '.v.', '_00_']
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(mod) ⇒ Object
13 14 15 16 |
# File 'lib/lobstersbot/plugins/salute.rb', line 13 def self.included(mod) handler = ->(bot, channel, _nick, _match) { bot.salute_user channel } mod.add_trigger(100, /\AV.v.V\z/i, handler) end |
Instance Method Details
#salute_user(channel) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/lobstersbot/plugins/salute.rb', line 6 def salute_user(channel) claws = @@claws.sample 2 face = @@faces.sample lobster = claws[0] + face + claws[1] privmsg(lobster, channel) end |