Class: Markify::Bot

Inherits:
Object
  • Object
show all
Defined in:
lib/markify/bot.rb

Instance Method Summary collapse

Constructor Details

#initialize(id, password) ⇒ Bot

Returns a new instance of Bot.



24
25
26
27
28
29
# File 'lib/markify/bot.rb', line 24

def initialize(id, password)
  @client = Jabber::Client.new(id)

  @client.connect
  @client.auth(password)
end

Instance Method Details

#send_message(receiver, message) ⇒ Object



31
32
33
34
35
# File 'lib/markify/bot.rb', line 31

def send_message(receiver, message)
  receiver.each do |r|
    @client.send(Jabber::Message.new(r, message))
  end
end