ika_bot/lib/console_handler.rb

20 lines
341 B
Ruby
Raw Permalink Normal View History

2025-08-23 14:38:42 -04:00
require_relative './ika'
class ConsoleHandler < Ika
def start!
@handling_messages = true
while @handling_messages
handle_message Message::Console.new(responder(nil), gets.chomp)
end
end
def stop!
@handling_messages = false
end
def responder(_)
lambda { |response| puts "<Ika> #{response}" }
end
end