Skip to content

Instantly share code, notes, and snippets.

@mapyo
Created July 24, 2013 23:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mapyo/6075465 to your computer and use it in GitHub Desktop.
Save mapyo/6075465 to your computer and use it in GitHub Desktop.
隣の人のソースをforkして公開用に結構いろいろいじったbot
# coding: utf-8
require 'date'
require 'cinch'
class HogehogeBot
include Cinch::Plugin
@@reviewer="誰かな"
timer 60, method: :check
def check
if(Time.now.strftime("%H%M") == "1005")
Channel('#hogehoge').notice("おはようございます(~O~)今日の担当の人は「今日の人」と叫んでください。叫ばないと昨日の人のままですよっ(*´ڡ`●)")
end
end
end
bot = Cinch::Bot.new do
configure do |c|
c.server = "hogehoge.co.jp"
c.channels = ['#hogehoge']
c.nick = 'hogehoge_bot'
c.realname = 'hogehoge_bot'
c.user = 'hogehoge_bot'
c.plugins.plugins = [HogehogeBot]
end
on :message, /今日の人/ do |m|
$reviewer="#{m.user.nick}"
m.reply "今日の担当は #{$reviewer} さんです。お願いしまっす!"
m.reply "もし担当が誰か知りたい時は、「今日の担当」と叫んで下さいねー(`・ω・´)ゞ"
end
on :message, /今日の担当/ do |m|
m.reply "#{$reviewer} さんお願いしやっす!!(*´ڡ`●)"
end
end
$reviewer='誰かです';
bot.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment