summaryrefslogtreecommitdiffstats
path: root/modules/Help.rb
blob: d4a6d1fa9f5c11547f438cde4ddc136f0aa8a05c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'xmpp4r/message'

require_relative '../module_base'

module Lain
  module Modules
    class Help < Base
      def on_message(muc, message)
        return unless /\A!help\b/ =~ message.body

        muc.say("\nBEGIN COMMAND LIST" + @lain.commands.reduce('') { |s, cmd| s + "\n#{cmd[0]}: #{cmd[1]}" } + "\nEND COMMAND LIST")
      end

      def commands
        {
          '!help' => 'show this help'
        }
      end
    end
  end
end