class Cognition::Plugins::Default

Public Instance Methods

help(msg, match_data = nil) click to toggle source
# File lib/cognition/plugins/default.rb, line 19
def help(msg, match_data = nil)
  type = msg.metadata[: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(*) click to toggle source

rubocop:enable Lint/AmbiguousRegexpLiteral

# File lib/cognition/plugins/default.rb, line 15
def pong(*)
  "PONG"
end