Skip to content
This repository has been archived by the owner on Jan 20, 2021. It is now read-only.

Commit

Permalink
[v0.3.54] Learn queries from Telegram users
Browse files Browse the repository at this point in the history
- Enable bot to start learning

Signed-off-by: Kenneth Ham <kenneth.ham@comp.nus.edu.sg>
  • Loading branch information
kennetham committed Jul 22, 2015
1 parent d51150c commit bf15c91
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/engine/brain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def initialize

public

def pre_process(query)
def learn(query)
@@processed_store = @@core.message(query)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/nusbotgram/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module NUSBotgram
VERSION = "0.3.53"
VERSION = "0.3.54"
end
3 changes: 3 additions & 0 deletions venus.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'httparty'
require 'json'
require 'rest_client'
require 'yaml'

require_relative 'lib/nus_botgram'
Expand All @@ -13,6 +14,7 @@ class Venus
bot = NUSBotgram::Bot.new(CONFIG[0][:T_BOT_APIKEY_DEV])
engine = NUSBotgram::Core.new
models = NUSBotgram::Models.new
brain = NUSBotgram::Brain.new

# Custom Regex Queries for dynamic command
custom_today = ""
Expand All @@ -22,6 +24,7 @@ class Venus
time_now = Time.now.getlocal('+08:00')

engine.save_message_history(message.from.id, 1, message.chat.id, message.message_id, message.from.first_name, message.from.last_name, message.from.username, message.from.id, message.date, message.text)
brain.learn(message.text)
puts "In chat #{message.chat.id}, @#{message.from.first_name} > @#{message.from.id} said: #{message.text}"

engine.save_state_transactions(message.from.id, message.text, message.message_id)
Expand Down

0 comments on commit bf15c91

Please sign in to comment.