Class: Cognition::Plugins::Default
- Defined in:
- lib/cognition/plugins/default.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
definitions, inherited, #initialize, match, #render
Constructor Details
This class inherits a constructor from Cognition::Plugins::Base
Instance Method Details
#help(msg, match_data = nil) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/cognition/plugins/default.rb', line 17 def help(msg, match_data = nil) type = msg.[:type] ||= "text" if match_data[:command].nil? || match_data[:command].empty? @help = bot.help else @help = bot.help.find_all { |text| text.match match_data[:command] } end render(type: type) end |
#pong(msg, match_data = nil) ⇒ Object
13 14 15 |
# File 'lib/cognition/plugins/default.rb', line 13 def pong(msg, match_data = nil) 'PONG' end |