From 4875126983a2c35202750df2b724cf906525bdbe Mon Sep 17 00:00:00 2001 From: Alexander Munch-Hansen Date: Wed, 1 Nov 2017 13:17:16 +0100 Subject: [PATCH] Added config --- taylor_bot.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/taylor_bot.rb b/taylor_bot.rb index f1f7f77..b517763 100644 --- a/taylor_bot.rb +++ b/taylor_bot.rb @@ -1,6 +1,7 @@ require 'cinch' require_relative 'DictionaryGenerator' require_relative 'SentenceGenerator' +require_relative 'config' love_file = File.open("love_story.txt","r").read @@ -12,23 +13,23 @@ text = love_file + our_file + shouldve_file @dictionary = DictionaryGenerator.new(2) @dictionary.insert_text text -@sentenceGen = SentenceGenerator.new(@dictionary) +sentenceGen = SentenceGenerator.new(@dictionary) puts "-------------------------------------" -puts @sentenceGen.generate_sentence +puts sentenceGen.generate_sentence puts "-------------------------------------" bot = Cinch::Bot.new do configure do |c| c.nick = 'TaylorSwift' - c.server = 'nick' - c.port = 0 - c.channels = [] + c.server = SERVER_ADDRESS + c.port = PORT + c.channels = CHANNELS c.ssl.use = true end on :message, /.*(?i)(.).*taylor.*/ do |m| - to_reply = @sentenceGen.generate_sentence + to_reply = sentenceGen.generate_sentence sec_to_sleep = to_reply.size * 0.01+1 sleep(sec_to_sleep) m.reply to_reply