Module: Examples::Foo
- Defined in:
- lib/erasmus/examples.rb
Class Method Summary collapse
-
.extended(obj) ⇒ Object
this is how we handle flags that the bot will respond to.
Instance Method Summary collapse
Class Method Details
.extended(obj) ⇒ Object
this is how we handle flags that the bot will respond to
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/erasmus/examples.rb', line 8 def self.extended(obj) obj.instance_eval { @flags['foo'] = lambda { |user, host, arguments, source| say('bar') } @flags['bar'] = lambda { |user, host, arguments, source| if source == :hilight notice_user(user, 'baz') end if source == :flag say("Hey everyone, #{user} wants to bar.") end } @flags['baz'] = lambda { |user, host, arguments, source| notice_channel('not baz!') } } end |
Instance Method Details
#handle_private_message(user, host, message) ⇒ Object
3 4 5 |
# File 'lib/erasmus/examples.rb', line 3 def (user, host, ) pm_user(user, 'hey!') end |
#join ⇒ Object
27 28 29 30 |
# File 'lib/erasmus/examples.rb', line 27 def join @server.say "JOIN ##{@name}" say "#{1.chr}ACTION is here to help#{1.chr}" end |