mirror of
https://github.com/thewesker/ebooks_example.git
synced 2025-12-23 22:01:14 -05:00
BESPOKE CHANGES FOR ROBINBOT
This commit is contained in:
16
bots.rb
16
bots.rb
@@ -63,11 +63,10 @@ class BoodooBot
|
||||
@attempts = 0
|
||||
@followers = []
|
||||
@following = []
|
||||
@archive_path = "corpus/#{@original}.json"
|
||||
@model_path = "model/#{@original}.model"
|
||||
@archive_path = "corpus/robin.csv"
|
||||
@model_path = "model/robin.model"
|
||||
|
||||
if can_run?
|
||||
get_archive!
|
||||
make_model!
|
||||
else
|
||||
missing_fields.each {|missing|
|
||||
@@ -101,12 +100,6 @@ class BoodooBot
|
||||
scheduler.interval @update_follows_interval do
|
||||
follow_parity
|
||||
end
|
||||
|
||||
scheduler.interval @refresh_model_interval do
|
||||
log "Refreshing archive/model..."
|
||||
get_archive!
|
||||
make_model!
|
||||
end
|
||||
end
|
||||
|
||||
def on_message(dm)
|
||||
@@ -229,8 +222,11 @@ class BoodooBot
|
||||
def load_model!
|
||||
return if @model
|
||||
|
||||
@model_path ||= "model/#{original}.model"
|
||||
@corpus_path ||= "corpus/robin.csv"
|
||||
@model_path ||= "model/robin.model"
|
||||
|
||||
log "Consuming corpus #{@corpus_path}"
|
||||
Ebooks::Model.consume(@corpus_path).save(@model_path)
|
||||
log "Loading model #{model_path}"
|
||||
@model = Ebooks::Model.load(model_path)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user