summaryrefslogtreecommitdiffstats
path: root/modules/DDate.rb
blob: 317bf676260b1120794100ef0354ea9c4f9ea07d (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.send(Jabber::Message.new(muc.room, IO.popen("ddate").read.chomp))
      end

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