Forgot bot functionality
This commit is contained in:
parent
852251c6d6
commit
6f700fadfc
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user