Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- require "cinch"
- users = Hash.new
- bot = Cinch::Bot.new do
- configure do |c|
- c.nick = "SimpleBot"
- c.server = "irc.freenode.net"
- c.channels = ["#cinch-bots"]
- end
- on :message, /(^hi$|^sup$|^hi everyone$|^hello$)/ do |m|
- unless users.has_key? m.user.nick.downcase and users[m.user.nick.downcase] - Time.now < 60
- users[m.user.nick.downcase] = Time.now.to_i
- m.reply "Hi, #{m.user.nick}"
- end
- end
- end
- bot.start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement