Skip to content

Instantly share code, notes, and snippets.

@ianunruh
Last active December 16, 2015 17:09
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 ianunruh/5468097 to your computer and use it in GitHub Desktop.
Save ianunruh/5468097 to your computer and use it in GitHub Desktop.
Port of my Happening bot to Cinch
require 'cinch'
class Happening
include Cinch::Plugin
match /is it happening/i, :method => :happening, :use_prefix => false
match /happening (.+)/, :method => :add_happening
def initialize(s)
super
@happening = [
"It's over",
"It's happening",
"It's too late",
"You can't stop it",
"You asked for this",
"You could have prevented this",
"Why didn't you listen?",
"You didn't listen",
"It begins",
"It hasn't even begun",
"Check back tomorrow",
"It might be happening"
]
end
def happening(m)
m.reply '%s: "%s" -- Ron Paul' % [m.user.nick, @happening.sample]
end
def add_happening(m, happening)
@happening << happening
end
end
bot = Cinch::Bot.new do
configure do |c|
c.nick = 'DerpBot'
c.server = 'irc.freenode.net'
c.channels = ['#churchofswole']
c.verbose = true
c.plugins.plugins << Happening
end
end
bot.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment