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
- #help(msg, match_data = nil) ⇒ Object
-
#pong ⇒ Object
rubocop:enable Lint/AmbiguousRegexpLiteral.
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
19 20 21 22 23 24 25 26 27 |
# File 'lib/cognition/plugins/default.rb', line 19 def help(msg, match_data = nil) type = msg.[:type] ||= "text" if match_data[:command].nil? || match_data[:command].empty? @help = bot.help.sort else @help = bot.help.find_all { |text| text.match match_data[:command] } end render(type: type) end |
#pong ⇒ Object
rubocop:enable Lint/AmbiguousRegexpLiteral
15 16 17 |
# File 'lib/cognition/plugins/default.rb', line 15 def pong(*) "PONG" end |