Forgot bot functionality

This commit is contained in:
Alexander Munch-Hansen 2017-11-01 01:10:08 +01:00
parent 852251c6d6
commit 6f700fadfc

View File

@ -1,3 +1,4 @@
require 'cinch'
require_relative 'DictionaryGenerator'
require_relative 'SentenceGenerator'
@ -13,5 +14,25 @@ text = love_file + our_file + shouldve_file
@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.ssl.use = true
end
on :message, /.*(?i)(.).*taylor.*/ do |m|
to_reply = @sentenceGen.generate_sentence
sec_to_sleep = to_reply.size * 0.01+1
sleep(sec_to_sleep)
m.reply to_reply
end
end
bot.start