geewiz / twitch-bot

The twitch-bot Ruby gem for building Twitch chat bots

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Event handler registration is tedious

geewiz opened this issue · comments

Not having to call register_handler for each event handler would simplify the bot setup. Using Module composition instead of inheritance would allow us to use self.included to auto-register all the event handlers in a bot application.

Example code from GoRails:

module Example
  class << self
    attr_reader :registered
  end

  def self.include(base)
    (@registered ||= []) << base
  end
end