TubiaBot/tubiabot.rb

80 lines
1.4 KiB
Ruby
Raw Normal View History

2016-01-20 16:23:41 +01:00
# coding: utf-8
require 'cinch'
class ToniNegri
include Cinch::Plugin
match "toninegri"
def execute(m)
@bot.nick = "toninegri"
m.reply "swasp: sono tuo padre"
@bot.nick = "TubiaBot"
end
end
class Caffe
include Cinch::Plugin
2016-01-20 16:40:56 +01:00
match /caff(è|e)/
2016-01-20 16:23:41 +01:00
def execute(m)
users = [ "qup", "imega", "gresci" ]
requests = [ "andiamo al bar?", "caffè?", "bar?" ]
m.reply users.sample+": "+requests.sample
end
end
2016-01-21 10:18:47 +01:00
class Amici
include Cinch::Plugin
match /lavor(o|are|atori)/
def execute(m)
2016-01-22 10:02:55 +01:00
users = [ "qup", "imega", "gresci", "jigen", "lgine", "encrypt", "thegamer" ]
2016-01-21 10:18:47 +01:00
requests = [ "oggi non ho voglia di fare un cazzo", "caffè?", "andiamo al bar?" ]
m.reply users.sample+" "+users.sample+" "+requests.sample
end
end
2016-01-22 10:02:55 +01:00
class JS
include Cinch::Plugin
match /js/
def execute(m)
frameworks = ["Angular", "React", "Ember", "Meteor"]
loves = ["è una figata", "è bellissimo"]
m.reply frameworks.sample+" "+loves.sample
end
end
2016-01-20 16:23:41 +01:00
2016-01-22 12:56:21 +01:00
class Salvino
include Cinch::Plugin
match /salvino/
def execute(m)
m.reply "FORZA SALVINO"+("O"*rand(3...10))
end
end
2016-01-20 16:23:41 +01:00
bot = Cinch::Bot.new do
configure do |c|
c.server = "irc.mufhd0.net"
c.nick = "TubiaBot"
c.channels = ["#indivia"]
2016-01-22 12:56:21 +01:00
c.plugins.plugins = [Caffe, ToniNegri, Amici, JS, Salvino]
end
end
logger = File.open("./logs.txt", 'a+')
bot.on :message do |m|
if m.user.nick == "Tubia87"
logger.write(m.message+"\n")
2016-01-20 16:23:41 +01:00
end
end
bot.start