misasagi
3/19/2013 - 2:00 AM

マジとヤバイを強いと本格的ににする irc bot. cite: http://blog.livedoor.jp/kinisoku/archives/3724378.html

マジとヤバイを強いと本格的ににする irc bot. cite: http://blog.livedoor.jp/kinisoku/archives/3724378.html

require 'cinch'

Process.daemon

bot = Cinch::Bot.new do
  configure do |c|
    c.server = 'irc.example.com'
    c.password = 'password'
    c.port = '1234'
    c.ssl.use = true
    c.realname = "HOGE, fuga"
    c.nick = "freshman"
    c.channels = ['#hoge']
  end

  on :message, /(やば|ヤバ)(い|イ)|(まじ|マジ)[で]?/ do |m|
    m.channel.notice m.message.gsub(/(やば|ヤバ)(い|イ)/, '強い').gsub(/(まじ|マジ)[で]?/, '本格的に')
  end
end

bot.start