Skip to content

Instantly share code, notes, and snippets.

@ckazu
Last active December 15, 2015 03:19
Show Gist options
  • Save ckazu/5193098 to your computer and use it in GitHub Desktop.
Save ckazu/5193098 to your computer and use it in GitHub Desktop.
マジとヤバイを強いと本格的ににする 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
@skuroki
Copy link

skuroki commented Mar 19, 2013

channelsの設定、#hogeがクォーテーションでくくられてないです

@ckazu
Copy link
Author

ckazu commented Mar 19, 2013

お,ありがとうございます.
修正しました.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment