Method: CeilingCat::Plugin::Base#handle

Defined in:
lib/ceiling_cat/plugins/base.rb

#handleObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/ceiling_cat/plugins/base.rb', line 10

def handle
  if command = commands.find{|command| body =~ /^(!|#{room.me.name}:?\s*)#{command[:command]}/i}
    begin
      if command[:public] || user.is_registered?
        self.send command[:method]
        return true
      end
    rescue => e
      reply "There was an error: #{$!}"
      raise e
    end
  end
end