Skip to content

Instantly share code, notes, and snippets.

@notblizzard
Last active August 29, 2015 14:24
Show Gist options
  • Save notblizzard/76907730d1da92f2977c to your computer and use it in GitHub Desktop.
Save notblizzard/76907730d1da92f2977c to your computer and use it in GitHub Desktop.
# Here we define plugins for the bot. This is different from commands.
module Plugin
attr_accessor :match, :classes
def self.included(base)
@classes = [] || @classes
@classes << base.name
end
def match str
@match = str
end
def self.classes
@classes
end
end
class Hello
include Plugin
match '/hello'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment