Sha256: b64941b4cfb6fc7a75d8bd066e55c6713716e0773359006329bc479418a2cb46

Contents?: true

Size: 562 Bytes

Versions: 3

Compression:

Stored size: 562 Bytes

Contents

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
botfly-0.3.6 lib/botfly/responder/common_responder_methods.rb
botfly-0.3.5 lib/botfly/responder/common_responder_methods.rb
botfly-0.3.4 lib/botfly/responder/common_responder_methods.rb