class SpsBot

Public Class Methods

new(host: '127.0.0.1', port: '8080', userid: 'bot', room: '', config: nil, typing_mode: false, drb: {host: 'bot.home', port: '60600'}) click to toggle source
Calls superclass method
# File lib/sps_bot.rb, line 11
def initialize(host: '127.0.0.1', port: '8080', userid: 'bot', 
               room: '', config: nil, typing_mode: false, 
               drb: {host: 'bot.home', port: '60600'})

  @bot = BotBaseDRbClient.new host: drb[:host], port: drb[:port]    
  @typing_mode = typing_mode
  super(host: host, port: port, userid: userid, room: room, 
        interactive: false)
  
end

Public Instance Methods

onincoming(sender, msg, typing_mode=false) click to toggle source
# File lib/sps_bot.rb, line 22
def onincoming(sender, msg, typing_mode=false)
  
  if not typing_mode then
    
    response = @bot.received sender, msg, mode: :chat
  
    self.send response unless response.empty?
  end

end