Sha256: 899f46c24b2c4a2686cb880f59b3528b21bfa75c5b6de392f422b4e92c64c8c4

Contents?: true

Size: 563 Bytes

Versions: 4

Compression:

Stored size: 563 Bytes

Contents

module Botfly
  module CommonResponderMethods
    def send(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
    
    def remove(responder_id)
      @bot.remove_responder(responder_id)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
botfly-0.3.2 lib/botfly/responder/common_responder_methods.rb
botfly-0.3.1 lib/botfly/responder/common_responder_methods.rb
botfly-0.3.0 lib/botfly/responder/common_responder_methods.rb
botfly-0.2.1 lib/botfly/responder/common_responder_methods.rb