Last active
December 16, 2015 17:09
-
-
Save ianunruh/5468097 to your computer and use it in GitHub Desktop.
Port of my Happening bot to Cinch
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
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