summaryrefslogtreecommitdiffstats
path: root/modules/DDate.rb
blob: 5f8634efcd868a93e24a199c56b1ef71c8fd16f3 (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 DDate < Base
      def on_message(muc, message)
        return unless /\A!ddate\b/ =~ message.body

        muc.say("DISCORDIAN DATE " + IO.popen("ddate").read.chomp)
      end

      def commands
        {
          '!ddate' => 'show Discordian date'
        }
      end
    end
  end
end