op8867555

cinch timer bot

Jul 30th, 2012
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.37 KB | None | 0 0
  1. require 'cinch'
  2. bot = Cinch::Bot.new do
  3.   configure do |c|
  4.    c.server = "irc.mibbit.net"
  5.    c.nick = "timer_bot"
  6.    c.channels = ["#bot_test"]    
  7.   end
  8.   on :privmsg, /^!callme (\d+)/i do |m,d|
  9.     Timer(60*d.to_i, shots: 1){m.reply "#{m.user.nick}, time's up."}
  10.   end
  11. end
  12. bot.start
  13.  
  14. #usage:
  15. # /q timer_bot !callme [n]
  16. # (bot will pm you back in n minutes.)
Advertisement
Add Comment
Please, Sign In to add comment