Module: Botfly::CommonResponderMethods

Included in:
Responder
Defined in:
lib/botfly/responder/common_responder_methods.rb

Instance Method Summary collapse

Instance Method Details

#remove(responder_id) ⇒ Object



16
17
18
# File 'lib/botfly/responder/common_responder_methods.rb', line 16

def remove(responder_id)
  @bot.remove_responder(responder_id)
end

#tell(nick, message, opts = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/botfly/responder/common_responder_methods.rb', line 3

def tell(nick, message, opts = {})
  Botfly.logger.debug("RSP: Sending message")

  # Fix the nickname if no domain/resource was given by adding your domain
  nick += "@" + @bot.jid.domain if nick !~ /@.*/
  
  opts = { :type => :chat }.merge(opts)
  msg = Jabber::Message.new(nick, message)
  msg.type    = opts[:type]
  msg.subject = opts[:subject]
  client.send(msg)
end