Class: SpsBot

Inherits:
SPSChat
  • Object
show all
Defined in:
lib/sps_bot.rb

Instance Method Summary collapse

Constructor Details

#initialize(host: '127.0.0.1', port: '8080', userid: 'bot', room: '', config: nil, typing_mode: false) ⇒ SpsBot



11
12
13
14
15
16
17
18
# File 'lib/sps_bot.rb', line 11

def initialize(host: '127.0.0.1', port: '8080', userid: 'bot', room: '', 
               config: nil, typing_mode: false)
  
  super(host: host, port: port, userid: userid, room: room)
  @bot = BotBase.new config
  @typing_mode = typing_mode
  
end

Instance Method Details

#onincoming(sender, msg, typing_mode = false) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/sps_bot.rb', line 20

def onincoming(sender, msg, typing_mode=false)
  
  if not typing_mode then
    #msg = 'tim'
    
    response = @bot.received sender, msg
  
    self.send response
  end

end