TubiaBot/tubiabot.rb
2016-05-10 13:44:33 +00:00

35 lines
837 B
Ruby

# coding: utf-8
require 'cinch'
require 'marky_markov'
require 'open-uri'
plugins = [ :Caffe, :ToniNegri, :Amici, :JS, :Salvino, :Jops, :Qup, :Vergogna, :Film, :Thegamer, :Roll, :Encrypt, :Tpo, :Radio, :VCN, :Bookmarks]
plugins.each do |plugin|
require './plugins/'+plugin.downcase.to_s
end
logger = File.open("./logs.txt", 'a+')
markov = MarkyMarkov::TemporaryDictionary.new
markov.parse_file './logs.txt'
bot = Cinch::Bot.new do
configure do |c|
c.server = "irc.ortiche.net"
c.nick = "TubiaBot"
c.channels = ["#indivia"]
c.plugins.plugins = plugins.map { |p| eval(p.to_s) }
end
end
bot.on :message do |m|
nicks = [ "Tubia87", "pippo" ]
if nicks.include? m.user.nick
#logger.write(m.message+"\n")
end
if m.message.include?(@bot.nick)
m.reply markov.generate_n_sentences 1
end
end
bot.start