隣の人のソースをforkして公開用に結構いろいろいじったbot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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